diff --git a/.quickstart/quickstart.yml b/.quickstart/quickstart.yml index a40ffba2..13500dcb 100644 --- a/.quickstart/quickstart.yml +++ b/.quickstart/quickstart.yml @@ -4,6 +4,12 @@ schema_key: salesforce_schema dbt_versions: ">=1.3.0 <3.0.0" table_variables: + salesforce__campaign_enabled: + - Campaign + salesforce__campaign_member_enabled: + - CampaignMember + salesforce__record_type_enabled: + - RecordType salesforce__user_role_enabled: - UserRole salesforce__lead_enabled: @@ -25,6 +31,7 @@ destination_configurations: - macro_namespace: dbt_utils search_order: [ 'spark_utils', 'dbt_utils' ] public_models: [ + "salesforce__campaign_performance", "salesforce__contact_enhanced", "salesforce__daily_activity", "salesforce__manager_performance", @@ -40,6 +47,11 @@ supported_vars: description: "Additional `ACCOUNT` columns to include in `salesforce__opportunity_enhanced` and `salesforce__contact_enhanced`" display_name: "Additional Account Columns" + salesforce__campaign_pass_through_columns: + type: dictionary + description: "Additional `CAMPAIGN` columns to include in `salesforce__campaign_performance`" + display_name: "Additional Campaign Columns" + salesforce__contact_pass_through_columns: type: dictionary description: "Additional `CONTACT` columns to include in `salesforce__contact_enhanced`" diff --git a/CHANGELOG.md b/CHANGELOG.md index c89ff6b9..ce66bb8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,22 @@ +# dbt_salesforce v2.3.0 + +[PR #84](https://github.com/fivetran/dbt_salesforce/pull/84) includes the following updates: + +## Schema/Data Change +**5 total changes • 1 possible breaking change** + +| Data Model(s) | Change type | Old | New | Notes | +| ---------- | ----------- | -------- | -------- | ----- | +| `salesforce__campaign_performance` | New model | — | One row per campaign | Requires the `campaign` source table. Conditionally joins `campaign_member` and `record_type`. | +| `salesforce__campaign_daily_history` | New model | — | One row per campaign per day | Disabled by default. Requires Salesforce History Mode and `salesforce__campaign_history_enabled: true`. | +| `salesforce__opportunity_enhanced` | New column | — | `opportunity_record_type_name` | Conditionally populated when `salesforce__record_type_enabled: true`. Joins `record_type` filtered to `sobject_type = 'Opportunity'`. | +| `stg_salesforce__campaign` | Column renamed | `record_type_id` | `campaign_member_record_type_id` | Reflects the Salesforce field `CampaignMemberRecordTypeId`, a campaign-level attribute. **Breaking for downstream models that reference `record_type_id` from this staging model.** | +| `stg_salesforce__campaign_member` | New columns | — | `account_id`, `created_by_id`, `has_opted_out_of_email`, `last_modified_by_id`, `lead_or_contact_id`, `lead_or_contact_owner_id` | Added identity and engagement fields for more complete member-level analysis. | + +## Feature Update +- `salesforce__campaign_performance` includes pipeline totals (`total_pipeline_amount`, `total_won_amount`), member volume (`campaign_member_count`, `responded_count`, `contact_count`, `lead_count`, `opted_out_of_email_count`), and ROI measures (`win_rate`, `cost_per_opportunity`, `cost_per_won_opportunity`, `roi`). +- Adds support for `salesforce__campaign_pass_through_columns` to pass custom campaign fields through to `salesforce__campaign_performance`. See the [README](https://github.com/fivetran/dbt_salesforce/blob/main/README.md#adding-passthrough-columns) for configuration details. + # dbt_salesforce v2.2.0 [PR #81](https://github.com/fivetran/dbt_salesforce/pull/81) includes the following updates: diff --git a/README.md b/README.md index 286dbba9..347693a0 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This dbt package transforms data from Fivetran's Salesforce connector into analy ## Resources -- Number of materialized models¹: 23 +- Number of materialized models¹: 27 - Connector documentation - [Salesforce connector documentation](https://fivetran.com/docs/connectors/applications/salesforce) - [Salesforce ERD](https://fivetran.com/docs/connectors/applications/salesforce#schemainformation) @@ -38,13 +38,15 @@ By default, this package materializes the following final tables: | [salesforce__manager_performance](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__manager_performance) | This table provides performance metrics by manager, showing team level pipeline, bookings, losses, and win rates.

**Example Analytics Questions:**
| | [salesforce__owner_performance](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__owner_performance) | This table provides an enhanced view of individual sales team members, including metrics around bookings, pipeline, losses, and win percentage.

**Example Analytics Questions:**
| | [salesforce__sales_snapshot](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__sales_snapshot) | This table provides a single-row snapshot of current and all-time sales funnel metrics.

**Example Analytics Questions:**
| -| [salesforce__opportunity_enhanced](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__opportunity_enhanced) | This table enriches opportunities with data about the associated account and opportunity owner.

**Example Analytics Questions:**
| +| [salesforce__opportunity_enhanced](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__opportunity_enhanced) | This table enriches opportunities with data about the associated account, opportunity owner, and record type.

**Example Analytics Questions:**
| | [salesforce__contact_enhanced](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__contact_enhanced) | This table enriches contacts with information about the associated account and contact owner.

**Example Analytics Questions:**
| | [salesforce__daily_activity](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__daily_activity) | This table provides a daily summary of sales activities related to the creation and conversion of leads, tasks, and opportunities.

**Example Analytics Questions:**
| | [salesforce__opportunity_line_item_enhanced](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__opportunity_line_item_enhanced) | This table showcases individual line items belonging to opportunities and adds associated product details.

**Example Analytics Questions:**
| -| [salesforce__account_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__account_daily_history) | **Not currently avaialble in Quickstart:** This table provides a daily record of each account, starting with its first active date and extending to its last active date, or the current date if the account is still active.

**Example Analytics Questions:**
| -| [salesforce__contact_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__contact_daily_history) | **Not currently avaialble in Quickstart:** This table provides a daily record of each contact, starting with its first active date and extending to its last active date, or the current date if the contact is still active.

**Example Analytics Questions:**
| -| [salesforce__opportunity_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__opportunity_daily_history) | **Not currently avaialble in Quickstart:** This table provides a daily record of each opportunity, starting with its first active date and extending to its last active date, or the current date if the opportunity is still active.

**Example Analytics Questions:**
| +| [salesforce__campaign_performance](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__campaign_performance) | This table provides campaign attribution metrics connecting campaign data to pipeline, revenue, and member engagement outcomes. Metrics include won revenue, member counts, response rates, and ROI.

**Example Analytics Questions:**
| +| [salesforce__account_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__account_daily_history) | **Not currently available in Quickstart:** This table provides a daily record of each account, starting with its first active date and extending to its last active date, or the current date if the account is still active.

**Example Analytics Questions:**
| +| [salesforce__contact_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__contact_daily_history) | **Not currently available in Quickstart:** This table provides a daily record of each contact, starting with its first active date and extending to its last active date, or the current date if the contact is still active.

**Example Analytics Questions:**
| +| [salesforce__opportunity_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__opportunity_daily_history) | **Not currently available in Quickstart:** This table provides a daily record of each opportunity, starting with its first active date and extending to its last active date, or the current date if the opportunity is still active.

**Example Analytics Questions:**
| +| [salesforce__campaign_daily_history](https://fivetran.github.io/dbt_salesforce/#!/model/model.salesforce.salesforce__campaign_daily_history) | **Not currently available in Quickstart:** This table provides a daily record of each campaign, starting with its first active date and extending to its last active date, or the current date if the campaign is still active.

**Example Analytics Questions:**
| **Note**: For Quickstart Data Model users only, in addition to the above output models that are Quickstart compatible, you will also receive models in your transformation list which replicate **all** of your Salesforce objects with the inclusion of the relevant formula fields in the generated output models. @@ -72,7 +74,7 @@ Include the following salesforce package version in your `packages.yml` ```yaml packages: - package: fivetran/salesforce - version: [">=2.2.0", "<2.3.0"] # we recommend using ranges to capture non-breaking changes automatically + version: [">=2.3.0", "<2.4.0"] # we recommend using ranges to capture non-breaking changes automatically ``` > All required sources and staging models are now bundled into this transformation package. Do not include `fivetran/salesforce_source` in your `packages.yml` since this package has been deprecated. @@ -134,7 +136,7 @@ For this use case, to ensure the package runs successfully, we recommend leverag > Note that all other end models (`salesforce__opportunity_enhanced`, `salesforce__opportunity_line_item_enhanced`, `salesforce__manager_performance`, `salesforce__owner_performance`, `salesforce__sales_snapshot`, and `salesforce__opportunity_daily_history`) will still materialize after a blanket `dbt run` but will be largely empty/null. ### (Optional) Utilizing Salesforce History Mode records -If you have Salesforce [History Mode](https://fivetran.com/docs/using-fivetran/features#historymode) enabled for your connection, we now include support for the `account`, `contact`, and `opportunity` tables directly. These staging models flow into our daily history models. This will allow you access to your historical data for these tables while taking advantage of incremental loads to help with compute. +If you have Salesforce [History Mode](https://fivetran.com/docs/using-fivetran/features#historymode) enabled for your connection, we now include support for the `account`, `campaign`, `contact`, and `opportunity` tables directly. These staging models flow into our daily history models. This will allow you access to your historical data for these tables while taking advantage of incremental loads to help with compute. #### IMPORTANT: How To Update Your History Models To ensure maximum value for these history mode models and avoid messy historical data that could come with picking and choosing which fields you bring in, **all fields in your Salesforce history mode connection are being synced into your end staging models**. That means all custom fields you picked to sync are being brought in to the final models. [See our DECISIONLOG for more details on why we are bringing in all fields](https://github.com/fivetran/dbt_salesforce/blob/main/DECISIONLOG.md). @@ -183,6 +185,7 @@ The History Mode models can get quite expansive since it will take in **ALL** hi vars: salesforce__account_history_enabled: true # False by default. Only use if you have history mode enabled and wish to view the full historical record of all your synced account fields, particularly in the daily account history model. + salesforce__campaign_history_enabled: true # False by default. Only use if you have history mode enabled and wish to view the full historical record of all your synced campaign fields, particularly in the daily campaign history model. salesforce__contact_history_enabled: true # False by default. Only use if you have history mode enabled and wish to view the full historical record of all your synced contact fields, particularly in the daily contact history model. salesforce__opportunity_history_enabled: true # False by default. Only use if you have history mode enabled and wish to view the full historical record of all your synced opportunity fields, particularly in the daily opportunity history model. ``` @@ -202,6 +205,7 @@ If you'd like to apply model-specific conditionals, configure the below variable ```yml vars: account_history_start_date: 'YYYY-MM-DD' # The first date in account history you wish to pull records from, filtering on `_fivetran_start`. + campaign_history_start_date: 'YYYY-MM-DD' # The first date in campaign history you wish to pull records from, filtering on `_fivetran_start`. contact_history_start_date: 'YYYY-MM-DD' # The first date in contact history you wish to pull records from, filtering on `_fivetran_start`. opportunity_history_start_date: 'YYYY-MM-DD' # The first date in opportunity history you wish to pull records from, filtering on `_fivetran_start`. ``` @@ -233,7 +237,7 @@ models: ``` #### Adding Passthrough Columns -This package allows users to add additional columns to the `salesforce__opportunity_enhanced`, `salesforce__opportunity_line_item_enhanced`,`salesforce__contact_enhanced`, and any of the `daily_history` models if you have Salesforce history mode enabled. You can do this by using the below variables in your `dbt_project.yml` file. These variables allow these additional columns to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables. +This package allows users to add additional columns to the `salesforce__opportunity_enhanced`, `salesforce__opportunity_line_item_enhanced`, `salesforce__contact_enhanced`, `salesforce__campaign_performance`, and any of the `daily_history` models if you have Salesforce history mode enabled. You can do this by using the below variables in your `dbt_project.yml` file. These variables allow these additional columns to be aliased (`alias`) and casted (`transform_sql`) if desired, but not required. Datatype casting is configured via a sql snippet within the `transform_sql` key. You may add the desired sql while omitting the `as field_name` at the end and your custom pass-though fields will be casted accordingly. Use the below format for declaring the respective pass-through variables. For the `salesforce__opportunity_enhanced` model, it joins in the `user` model two times, since an opportunity has both an owner and manager. The first time the `user` model is joined is to add information about an opportunity owner. The second time is to add information about an opportunity manager. Therefore to avoid ambiguous columns from joining in the same model twice, custom fields passed through from the user table will be suffixed based on whether it belongs to a user who is an `_owner` or a `_manager`. @@ -278,6 +282,9 @@ vars: alias: "user_role_field_x" salesforce__user_pass_through_columns: - name: "salesforce__user_field" + salesforce__campaign_pass_through_columns: + - name: "salesforce__campaign_field" + alias: "campaign_field_x" ``` > **NOTE:** If you are creating a passthrough column that applies `transform_sql` to a field already included by default, you must capitalize the `name` value like such: diff --git a/dbt_project.yml b/dbt_project.yml index 73921ede..dc9b05d1 100644 --- a/dbt_project.yml +++ b/dbt_project.yml @@ -1,6 +1,6 @@ config-version: 2 name: 'salesforce' -version: '2.2.0' +version: '2.3.0' require-dbt-version: [">=1.3.0", "<3.0.0"] models: salesforce: @@ -34,6 +34,8 @@ vars: salesforce__account_pass_through_columns: [] + salesforce__campaign_pass_through_columns: [] + salesforce__campaign_member_pass_through_columns: [] salesforce__contact_pass_through_columns: [] salesforce__event_pass_through_columns: [] salesforce__lead_pass_through_columns: [] diff --git a/docs/catalog.json b/docs/catalog.json index 379ddb6b..890b1081 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.11.2", "generated_at": "2026-01-15T14:49:54.484443Z", "invocation_id": "d62650ff-4b90-4b2c-8da2-69b967290cf5", "invocation_started_at": "2026-01-15T14:49:50.995942Z", "env": {}}, "nodes": {"seed.salesforce_integration_tests.sf_account_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "int_salesforce__date_spine", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__account_daily_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__contact_daily_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__contact_enhanced", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__daily_activity", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__manager_performance", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__opportunity_daily_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__opportunity_enhanced", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__owner_performance", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__sales_snapshot", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__account": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__account", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__account"}, "model.salesforce.stg_salesforce__account_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__account_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__account_history"}, "model.salesforce.stg_salesforce__contact": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__contact"}, "model.salesforce.stg_salesforce__contact_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__contact_history"}, "model.salesforce.stg_salesforce__event": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__event", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__event"}, "model.salesforce.stg_salesforce__lead": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__lead", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__lead"}, "model.salesforce.stg_salesforce__opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__opportunity"}, "model.salesforce.stg_salesforce__opportunity_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_history", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__opportunity_history"}, "model.salesforce.stg_salesforce__opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__opportunity_line_item"}, "model.salesforce.stg_salesforce__order": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__order", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__order"}, "model.salesforce.stg_salesforce__product_2": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__product_2", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__product_2"}, "model.salesforce.stg_salesforce__task": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__task", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__task"}, "model.salesforce.stg_salesforce__user": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__user", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__user"}, "model.salesforce.stg_salesforce__user_role": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__user_role", "database": "postgres", "comment": null, "owner": "postgres"}, "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.stg_salesforce__user_role"}}, "sources": {"source.salesforce.salesforce.account": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.account"}, "source.salesforce.salesforce_history.account": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.account"}, "source.salesforce.salesforce.contact": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.contact"}, "source.salesforce.salesforce_history.contact": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.contact"}, "source.salesforce.salesforce.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.event"}, "source.salesforce.salesforce.lead": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.lead"}, "source.salesforce.salesforce.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.opportunity"}, "source.salesforce.salesforce_history.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.opportunity"}, "source.salesforce.salesforce.opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.opportunity_line_item"}, "source.salesforce.salesforce.order": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.order"}, "source.salesforce.salesforce.product_2": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.product_2"}, "source.salesforce.salesforce.task": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.task"}, "source.salesforce.salesforce.user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.user"}, "source.salesforce.salesforce.user_role": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.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.11.12", "generated_at": "2026-07-15T16:25:28.429422Z", "invocation_id": "81fc0df1-bf08-45d1-930f-412ffdb89e1b", "invocation_started_at": "2026-07-15T16:25:24.350136Z", "env": {}}, "nodes": {"seed.salesforce_integration_tests.sf_account_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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_campaign_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 2, "name": "_fivetran_active", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 7, "name": "start_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 8, "name": "end_date", "comment": null}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "parent_id": {"type": "text", "index": 11, "name": "parent_id", "comment": null}, "budgeted_cost": {"type": "double precision", "index": 12, "name": "budgeted_cost", "comment": null}, "actual_cost": {"type": "double precision", "index": 13, "name": "actual_cost", "comment": null}, "number_of_leads": {"type": "integer", "index": 14, "name": "number_of_leads", "comment": null}, "number_of_converted_leads": {"type": "integer", "index": 15, "name": "number_of_converted_leads", "comment": null}, "number_of_contacts": {"type": "integer", "index": 16, "name": "number_of_contacts", "comment": null}, "number_of_responses": {"type": "integer", "index": 17, "name": "number_of_responses", "comment": null}, "number_of_opportunities": {"type": "integer", "index": 18, "name": "number_of_opportunities", "comment": null}, "number_of_won_opportunities": {"type": "integer", "index": 19, "name": "number_of_won_opportunities", "comment": null}, "amount_all_opportunities": {"type": "double precision", "index": 20, "name": "amount_all_opportunities", "comment": null}, "description": {"type": "text", "index": 21, "name": "description", "comment": null}, "campaign_member_record_type_id": {"type": "text", "index": 22, "name": "campaign_member_record_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.salesforce_integration_tests.sf_campaign_data"}, "seed.salesforce_integration_tests.sf_campaign_history_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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}, "id": {"type": "text", "index": 5, "name": "id", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "status": {"type": "text", "index": 8, "name": "status", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 9, "name": "start_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 10, "name": "end_date", "comment": null}, "is_active": {"type": "boolean", "index": 11, "name": "is_active", "comment": null}, "is_deleted": {"type": "boolean", "index": 12, "name": "is_deleted", "comment": null}, "parent_id": {"type": "integer", "index": 13, "name": "parent_id", "comment": null}, "budgeted_cost": {"type": "double precision", "index": 14, "name": "budgeted_cost", "comment": null}, "actual_cost": {"type": "double precision", "index": 15, "name": "actual_cost", "comment": null}, "number_of_leads": {"type": "integer", "index": 16, "name": "number_of_leads", "comment": null}, "number_of_converted_leads": {"type": "integer", "index": 17, "name": "number_of_converted_leads", "comment": null}, "number_of_contacts": {"type": "integer", "index": 18, "name": "number_of_contacts", "comment": null}, "number_of_responses": {"type": "integer", "index": 19, "name": "number_of_responses", "comment": null}, "number_of_opportunities": {"type": "integer", "index": 20, "name": "number_of_opportunities", "comment": null}, "number_of_won_opportunities": {"type": "integer", "index": 21, "name": "number_of_won_opportunities", "comment": null}, "amount_all_opportunities": {"type": "double precision", "index": 22, "name": "amount_all_opportunities", "comment": null}, "description": {"type": "text", "index": 23, "name": "description", "comment": null}, "campaign_member_record_type_id": {"type": "text", "index": 24, "name": "campaign_member_record_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "seed.salesforce_integration_tests.sf_campaign_history_data"}, "seed.salesforce_integration_tests.sf_campaign_member_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_member_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 2, "name": "_fivetran_active", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "account_id": {"type": "text", "index": 4, "name": "account_id", "comment": null}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": null}, "contact_id": {"type": "text", "index": 6, "name": "contact_id", "comment": null}, "created_by_id": {"type": "text", "index": 7, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 8, "name": "created_date", "comment": null}, "first_responded_date": {"type": "timestamp without time zone", "index": 9, "name": "first_responded_date", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 10, "name": "has_opted_out_of_email", "comment": null}, "has_responded": {"type": "boolean", "index": 11, "name": "has_responded", "comment": null}, "is_deleted": {"type": "boolean", "index": 12, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "lead_id": {"type": "text", "index": 14, "name": "lead_id", "comment": null}, "lead_or_contact_id": {"type": "text", "index": 15, "name": "lead_or_contact_id", "comment": null}, "lead_or_contact_owner_id": {"type": "text", "index": 16, "name": "lead_or_contact_owner_id", "comment": null}, "status": {"type": "text", "index": 17, "name": "status", "comment": null}}, "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_campaign_member_data"}, "seed.salesforce_integration_tests.sf_contact_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "integer", "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": "public", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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_record_type_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_record_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "sobject_type": {"type": "text", "index": 6, "name": "sobject_type", "comment": null}, "is_active": {"type": "boolean", "index": 7, "name": "is_active", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "namespace_prefix": {"type": "integer", "index": 9, "name": "namespace_prefix", "comment": null}}, "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_record_type_data"}, "seed.salesforce_integration_tests.sf_task_data": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "int_salesforce__date_spine", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "int_salesforce__opportunity_aggregation_by_owner", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "public_salesforce_dev", "name": "salesforce__account_daily_history", "database": "postgres", "comment": "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.", "owner": "postgres"}, "columns": {"account_day_id": {"type": "text", "index": 1, "name": "account_day_id", "comment": "Surrogate key hashed on `date_day` and `account_id`"}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": "Date on which the account had these field values."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `account_id`."}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_number": {"type": "integer", "index": 10, "name": "account_number", "comment": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "account_source": {"type": "text", "index": 11, "name": "account_source", "comment": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "annual_revenue": {"type": "double precision", "index": 12, "name": "annual_revenue", "comment": "Estimated annual revenue of the account."}, "billing_city": {"type": "text", "index": 13, "name": "billing_city", "comment": "Details for the billing address of this account."}, "billing_country": {"type": "text", "index": 14, "name": "billing_country", "comment": "Details for the billing address of this account."}, "billing_postal_code": {"type": "text", "index": 15, "name": "billing_postal_code", "comment": "Details for the billing address of this account."}, "billing_state": {"type": "text", "index": 16, "name": "billing_state", "comment": "Details for the billing address of this account."}, "billing_street": {"type": "text", "index": 17, "name": "billing_street", "comment": "Street address for the billing address of this account."}, "description": {"type": "text", "index": 18, "name": "description", "comment": null}, "industry": {"type": "text", "index": 19, "name": "industry", "comment": "An industry associated with this account."}, "is_deleted": {"type": "boolean", "index": 20, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": "Value is one of the following, whichever is the most recent."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": "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."}, "master_record_id": {"type": "text", "index": 24, "name": "master_record_id", "comment": "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."}, "name": {"type": "text", "index": 25, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 26, "name": "number_of_employees", "comment": "Number of employees working at the company represented by this account."}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": "The ID of the user who currently owns this account."}, "ownership": {"type": "integer", "index": 28, "name": "ownership", "comment": "Ownership type for the account, for example Private, Public, or Subsidiary."}, "parent_id": {"type": "integer", "index": 29, "name": "parent_id", "comment": "ID of the parent object, if any."}, "rating": {"type": "integer", "index": 30, "name": "rating", "comment": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "record_type_id": {"type": "text", "index": 31, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "shipping_city": {"type": "integer", "index": 32, "name": "shipping_city", "comment": "Details of the shipping address for this account."}, "shipping_country": {"type": "text", "index": 33, "name": "shipping_country", "comment": "Details of the shipping address for this account. Country."}, "shipping_postal_code": {"type": "integer", "index": 34, "name": "shipping_postal_code", "comment": "Details of the shipping address for this account. Postal code."}, "shipping_state": {"type": "integer", "index": 35, "name": "shipping_state", "comment": "Details of the shipping address for this account. State."}, "shipping_street": {"type": "integer", "index": 36, "name": "shipping_street", "comment": "The street address of the shipping address for this account."}, "type": {"type": "text", "index": 37, "name": "type", "comment": "Type of account, for example, Customer, Competitor, or Partner."}, "website": {"type": "text", "index": 38, "name": "website", "comment": "The website of this account."}, "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__campaign_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "salesforce__campaign_daily_history", "database": "postgres", "comment": "Each record is a daily snapshot of a campaign, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "owner": "postgres"}, "columns": {"campaign_day_id": {"type": "text", "index": 1, "name": "campaign_day_id", "comment": "Surrogate key hashed on `date_day` and `campaign_id`."}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": "Date on which the campaign had these field values."}, "campaign_id": {"type": "text", "index": 3, "name": "campaign_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `campaign_id`."}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "name": {"type": "text", "index": 10, "name": "name", "comment": null}, "type": {"type": "text", "index": 11, "name": "type", "comment": null}, "status": {"type": "text", "index": 12, "name": "status", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 13, "name": "start_date", "comment": "Starting date for the campaign."}, "end_date": {"type": "timestamp without time zone", "index": 14, "name": "end_date", "comment": "Ending date for the campaign."}, "is_active": {"type": "boolean", "index": 15, "name": "is_active", "comment": "Indicates whether the campaign is active (true) or not (false)."}, "is_deleted": {"type": "boolean", "index": 16, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "parent_id": {"type": "integer", "index": 17, "name": "parent_id", "comment": null}, "budgeted_cost": {"type": "double precision", "index": 18, "name": "budgeted_cost", "comment": "Amount of money budgeted for the campaign."}, "actual_cost": {"type": "double precision", "index": 19, "name": "actual_cost", "comment": "Amount of money spent to run the campaign."}, "number_of_leads": {"type": "integer", "index": 20, "name": "number_of_leads", "comment": "Number of leads associated with the campaign."}, "number_of_converted_leads": {"type": "integer", "index": 21, "name": "number_of_converted_leads", "comment": "Number of leads associated with the campaign that have been converted."}, "number_of_contacts": {"type": "integer", "index": 22, "name": "number_of_contacts", "comment": "Number of contacts associated with the campaign."}, "number_of_responses": {"type": "integer", "index": 23, "name": "number_of_responses", "comment": "Number of contacts and leads that responded to the campaign."}, "number_of_opportunities": {"type": "integer", "index": 24, "name": "number_of_opportunities", "comment": "Number of opportunities where this campaign is the primary campaign source."}, "number_of_won_opportunities": {"type": "integer", "index": 25, "name": "number_of_won_opportunities", "comment": "Number of closed-won opportunities where this campaign is the primary campaign source."}, "amount_all_opportunities": {"type": "double precision", "index": 26, "name": "amount_all_opportunities", "comment": null}, "description": {"type": "text", "index": 27, "name": "description", "comment": null}, "campaign_member_record_type_id": {"type": "text", "index": 28, "name": "campaign_member_record_type_id", "comment": "ID of the record type assigned to campaign members of this campaign."}, "row_num": {"type": "bigint", "index": 29, "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__campaign_daily_history"}, "model.salesforce.salesforce__campaign_performance": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "salesforce__campaign_performance", "database": "postgres", "comment": "Each record represents a campaign, enriched with pipeline, revenue, member volume, conversion rates, and ROI metrics.", "owner": "postgres"}, "columns": {"campaign_id": {"type": "text", "index": 1, "name": "campaign_id", "comment": "The unique, system-generated ID assigned during creation."}, "campaign_name": {"type": "text", "index": 2, "name": "campaign_name", "comment": "Name of the campaign."}, "campaign_type": {"type": "text", "index": 3, "name": "campaign_type", "comment": "Type of campaign, such as Direct Mail, Email, or Webinar."}, "campaign_status": {"type": "text", "index": 4, "name": "campaign_status", "comment": "Status of the campaign, such as Planned, In Progress, or Completed."}, "start_date": {"type": "timestamp without time zone", "index": 5, "name": "start_date", "comment": "Starting date for the campaign."}, "end_date": {"type": "timestamp without time zone", "index": 6, "name": "end_date", "comment": "Ending date for the campaign."}, "is_active": {"type": "boolean", "index": 7, "name": "is_active", "comment": "Indicates whether the campaign is active (true) or not (false)."}, "parent_campaign_id": {"type": "text", "index": 8, "name": "parent_campaign_id", "comment": "The ID of the parent campaign, if applicable."}, "budgeted_cost": {"type": "numeric(28,6)", "index": 9, "name": "budgeted_cost", "comment": "Amount of money budgeted for the campaign."}, "actual_cost": {"type": "numeric(28,6)", "index": 10, "name": "actual_cost", "comment": "Amount of money spent to run the campaign."}, "number_of_leads": {"type": "integer", "index": 11, "name": "number_of_leads", "comment": "Number of leads associated with the campaign."}, "number_of_converted_leads": {"type": "integer", "index": 12, "name": "number_of_converted_leads", "comment": "Number of leads associated with the campaign that have been converted."}, "number_of_contacts": {"type": "integer", "index": 13, "name": "number_of_contacts", "comment": "Number of contacts associated with the campaign."}, "number_of_responses": {"type": "integer", "index": 14, "name": "number_of_responses", "comment": "Number of contacts and leads that responded to the campaign."}, "number_of_opportunities": {"type": "integer", "index": 15, "name": "number_of_opportunities", "comment": "Number of opportunities where this campaign is the primary campaign source."}, "number_of_won_opportunities": {"type": "integer", "index": 16, "name": "number_of_won_opportunities", "comment": "Number of closed-won opportunities where this campaign is the primary campaign source."}, "total_pipeline_amount": {"type": "numeric(28,6)", "index": 17, "name": "total_pipeline_amount", "comment": "Total amount of all open and closed opportunities where this campaign is the primary campaign source."}, "campaign_member_count": {"type": "bigint", "index": 18, "name": "campaign_member_count", "comment": "Total number of campaign members (contacts and leads) associated with this campaign. Only present if the campaign_member table is enabled."}, "opted_out_of_email_count": {"type": "bigint", "index": 19, "name": "opted_out_of_email_count", "comment": "Number of campaign members who have opted out of email communications. Only present if the campaign_member table is enabled."}, "responded_count": {"type": "bigint", "index": 20, "name": "responded_count", "comment": "Number of campaign members who have responded to the campaign. Only present if the campaign_member table is enabled."}, "contact_count": {"type": "bigint", "index": 21, "name": "contact_count", "comment": "Number of campaign members who are contacts. Only present if the campaign_member table is enabled."}, "lead_count": {"type": "bigint", "index": 22, "name": "lead_count", "comment": "Number of campaign members who are leads. Only present if the campaign_member table is enabled."}, "campaign_member_record_type_name": {"type": "text", "index": 23, "name": "campaign_member_record_type_name", "comment": "Name of the campaign member record type associated with this campaign. Only present if the record_type table is enabled."}, "total_won_amount": {"type": "numeric", "index": 24, "name": "total_won_amount", "comment": "Sum of the closed-won opportunity amounts where this campaign is the primary campaign source."}, "win_rate": {"type": "integer", "index": 25, "name": "win_rate", "comment": "Ratio of won opportunities to total opportunities. Null if there are no opportunities."}, "cost_per_opportunity": {"type": "numeric", "index": 26, "name": "cost_per_opportunity", "comment": "Actual cost divided by the number of opportunities. Null if actual cost is not set."}, "cost_per_won_opportunity": {"type": "numeric", "index": 27, "name": "cost_per_won_opportunity", "comment": "Actual cost divided by the number of won opportunities. Null if actual cost is not set."}, "roi": {"type": "numeric", "index": 28, "name": "roi", "comment": "Return on investment, calculated as (total_won_amount - actual_cost) / actual_cost. Null if actual cost is not set."}}, "stats": {"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__campaign_performance"}, "model.salesforce.salesforce__contact_daily_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "salesforce__contact_daily_history", "database": "postgres", "comment": "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.", "owner": "postgres"}, "columns": {"contact_day_id": {"type": "text", "index": 1, "name": "contact_day_id", "comment": "Surrogate key hashed on `date_day` and `contact_id`"}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": "Date on which the opportunity had these field values."}, "contact_id": {"type": "text", "index": 3, "name": "contact_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `contact_id`."}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": "ID of the account that\u2019s the parent of this contact."}, "email": {"type": "text", "index": 11, "name": "email", "comment": "The contact\u2019s email address."}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": "The contact\u2019s first name up to 40 characters."}, "is_deleted": {"type": "boolean", "index": 13, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "last_activity_date": {"type": "timestamp without time zone", "index": 14, "name": "last_activity_date", "comment": "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"}, "last_modified_by_id": {"type": "text", "index": 15, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 16, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": "Required. Last name of the contact up to 80 characters."}, "last_referenced_date": {"type": "integer", "index": 18, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": "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."}, "mailing_city": {"type": "text", "index": 20, "name": "mailing_city", "comment": "City mailing address details."}, "mailing_country": {"type": "text", "index": 21, "name": "mailing_country", "comment": "Country mailing address details."}, "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": "Postal code mailing address details."}, "mailing_state": {"type": "text", "index": 24, "name": "mailing_state", "comment": "State mailing address details."}, "mailing_street": {"type": "text", "index": 25, "name": "mailing_street", "comment": "Street mailing address details."}, "master_record_id": {"type": "integer", "index": 26, "name": "master_record_id", "comment": "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"}, "mobile_phone": {"type": "integer", "index": 27, "name": "mobile_phone", "comment": "Contact\u2019s mobile phone number."}, "name": {"type": "text", "index": 28, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 29, "name": "owner_id", "comment": "The ID of the owner of the account associated with this contact. This is a relationship field.\n"}, "phone": {"type": "text", "index": 30, "name": "phone", "comment": "Telephone number for the contact. Label is Business Phone."}, "reports_to_id": {"type": "integer", "index": 31, "name": "reports_to_id", "comment": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n"}, "title": {"type": "text", "index": 32, "name": "title", "comment": "Title"}, "lead_source": {"type": "text", "index": 33, "name": "lead_source", "comment": "The lead\u2019s source."}, "description": {"type": "text", "index": 34, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 35, "name": "individual_id", "comment": "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."}, "home_phone": {"type": "integer", "index": 36, "name": "home_phone", "comment": "The contact\u2019s home telephone number."}, "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": "public_salesforce_dev", "name": "salesforce__contact_enhanced", "database": "postgres", "comment": "Each record represents a contact with additional account and owner information.", "owner": "postgres"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": "Unique contact ID."}, "contact_name": {"type": "text", "index": 2, "name": "contact_name", "comment": "Name of contact."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "ID of contact's account."}, "department": {"type": "text", "index": 4, "name": "department", "comment": "The contact\u2019s department."}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": "A description of the contact."}, "email": {"type": "text", "index": 6, "name": "email", "comment": "The contact\u2019s email address."}, "individual_id": {"type": "text", "index": 7, "name": "individual_id", "comment": "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."}, "contact_is_deleted": {"type": "boolean", "index": 8, "name": "contact_is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "last_activity_date": {"type": "timestamp without time zone", "index": 9, "name": "last_activity_date", "comment": "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."}, "lead_source": {"type": "text", "index": 10, "name": "lead_source", "comment": "The lead\u2019s source."}, "mailing_city": {"type": "text", "index": 11, "name": "mailing_city", "comment": "Mailing address details."}, "mailing_country": {"type": "text", "index": 12, "name": "mailing_country", "comment": "Mailing address details."}, "mailing_country_code": {"type": "text", "index": 13, "name": "mailing_country_code", "comment": "Mailing address details."}, "mailing_postal_code": {"type": "text", "index": 14, "name": "mailing_postal_code", "comment": "The ISO codes for the mailing address\u2019s state and country."}, "mailing_state": {"type": "text", "index": 15, "name": "mailing_state", "comment": "Mailing address details."}, "mailing_state_code": {"type": "text", "index": 16, "name": "mailing_state_code", "comment": "The ISO codes for the mailing address\u2019s state and country."}, "mailing_street": {"type": "text", "index": 17, "name": "mailing_street", "comment": "Street address for mailing address."}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": "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."}, "mobile_phone": {"type": "text", "index": 19, "name": "mobile_phone", "comment": "Contact\u2019s mobile phone number."}, "contact_owner_id": {"type": "text", "index": 20, "name": "contact_owner_id", "comment": "The ID of the owner of the account associated with this contact."}, "phone": {"type": "text", "index": 21, "name": "phone", "comment": "Telephone number for the contact. Label is Business Phone."}, "reports_to_id": {"type": "text", "index": 22, "name": "reports_to_id", "comment": "This field doesn\u2019t appear if IsPersonAccount is true.\nThis is a relationship field."}, "contact_owner_name": {"type": "text", "index": 23, "name": "contact_owner_name", "comment": "Name of owner of the account associated with this contact."}, "account_name": {"type": "text", "index": 24, "name": "account_name", "comment": "Name of the account."}, "account_number": {"type": "text", "index": 25, "name": "account_number", "comment": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "account_source": {"type": "text", "index": 26, "name": "account_source", "comment": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "account_annual_revenue": {"type": "numeric(28,6)", "index": 27, "name": "account_annual_revenue", "comment": "Estimated annual revenue of the account."}, "account_description": {"type": "text", "index": 28, "name": "account_description", "comment": "Text description of the account."}, "account_industry": {"type": "text", "index": 29, "name": "account_industry", "comment": "An industry associated with this account."}, "account_is_deleted": {"type": "boolean", "index": 30, "name": "account_is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "account_number_of_employees": {"type": "integer", "index": 31, "name": "account_number_of_employees", "comment": "Number of employees working at the company represented by this account."}, "account_owner_id": {"type": "text", "index": 32, "name": "account_owner_id", "comment": "The ID of the user who currently owns this account."}, "account_parent_id": {"type": "text", "index": 33, "name": "account_parent_id", "comment": "ID of the account parent object, if any."}, "account_rating": {"type": "text", "index": 34, "name": "account_rating", "comment": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "account_type": {"type": "text", "index": 35, "name": "account_type", "comment": "Type of account, for example, Customer, Competitor, or Partner."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__daily_activity", "database": "postgres", "comment": "Each record represents a daily summary of the number of sales activities, for example tasks and opportunities closed.", "owner": "postgres"}, "columns": {"date_day": {"type": "timestamp without time zone", "index": 1, "name": "date_day", "comment": "Day of event, in UTC."}, "leads_created": {"type": "bigint", "index": 2, "name": "leads_created", "comment": "Number of leads created on that date."}, "leads_converted": {"type": "bigint", "index": 3, "name": "leads_converted", "comment": "Number of leads converted on that date."}, "tasks_completed": {"type": "bigint", "index": 4, "name": "tasks_completed", "comment": "Number of tasks for that activity date."}, "events_completed": {"type": "bigint", "index": 5, "name": "events_completed", "comment": "Number of events for that activity date."}, "opportunities_created": {"type": "bigint", "index": 6, "name": "opportunities_created", "comment": "Number of opportunities created on that date."}, "opportunities_created_amount": {"type": "numeric", "index": 7, "name": "opportunities_created_amount", "comment": "The dollar amount of all opportunities created for this day."}, "opportunities_won": {"type": "bigint", "index": 8, "name": "opportunities_won", "comment": "Number of opportunities won on that close date."}, "opportunities_won_amount": {"type": "numeric", "index": 9, "name": "opportunities_won_amount", "comment": "The dollar amount of all opportunities won for this day."}, "opportunities_lost": {"type": "bigint", "index": 10, "name": "opportunities_lost", "comment": "Number of opportunities lost on that close date."}, "opportunities_lost_amount": {"type": "numeric", "index": 11, "name": "opportunities_lost_amount", "comment": "The dollar amount of all opportunities lost for this day."}, "pipeline_amount": {"type": "numeric", "index": 12, "name": "pipeline_amount", "comment": "The dollar amount of all opportunities in the pipeline for this day."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__manager_performance", "database": "postgres", "comment": "Each record represents a manager, enriched with data about their team's pipeline, bookings, loses, and win percentages.", "owner": "postgres"}, "columns": {"manager_id": {"type": "text", "index": 1, "name": "manager_id", "comment": "The user id of the manager."}, "manager_name": {"type": "text", "index": 2, "name": "manager_name", "comment": "The name of the opportunity owner's manager."}, "manager_city": {"type": "text", "index": 3, "name": "manager_city", "comment": "The city location of the opportunity owner's manager."}, "manager_state": {"type": "text", "index": 4, "name": "manager_state", "comment": "The state location of the opportunity owner's manager."}, "manager_position": {"type": "text", "index": 5, "name": "manager_position", "comment": "The position role of the opportunity owner's manager."}, "number_of_direct_reports": {"type": "bigint", "index": 6, "name": "number_of_direct_reports", "comment": "The number of opportunity owners who report to this manager."}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 7, "name": "bookings_amount_closed_this_month", "comment": "The opportunity amount, if closed this month and status is won."}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 8, "name": "bookings_amount_closed_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is won."}, "total_number_bookings": {"type": "numeric", "index": 9, "name": "total_number_bookings", "comment": "The opportunity count, if status is won."}, "total_bookings_amount": {"type": "numeric", "index": 10, "name": "total_bookings_amount", "comment": "The opportunity amount, if status is won."}, "bookings_count_closed_this_month": {"type": "numeric", "index": 11, "name": "bookings_count_closed_this_month", "comment": "The opportunity count, if closed this month and status is won."}, "bookings_count_closed_this_quarter": {"type": "numeric", "index": 12, "name": "bookings_count_closed_this_quarter", "comment": "The opportunity count, if closed this quarter and status is won."}, "largest_booking": {"type": "numeric", "index": 13, "name": "largest_booking", "comment": "The largest amount associated with a single opportunity."}, "lost_amount_this_month": {"type": "numeric", "index": 14, "name": "lost_amount_this_month", "comment": "The opportunity amount, if closed this month and status is lost."}, "lost_amount_this_quarter": {"type": "numeric", "index": 15, "name": "lost_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is lost."}, "total_number_lost": {"type": "numeric", "index": 16, "name": "total_number_lost", "comment": "The opportunity count, if status is lost."}, "total_lost_amount": {"type": "numeric", "index": 17, "name": "total_lost_amount", "comment": "The opportunity amount, if status is lost."}, "lost_count_this_month": {"type": "numeric", "index": 18, "name": "lost_count_this_month", "comment": "The opportunity count, if closed this month and status is lost."}, "lost_count_this_quarter": {"type": "numeric", "index": 19, "name": "lost_count_this_quarter", "comment": "The opportunity count, if closed this quarter and status is lost."}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 20, "name": "pipeline_created_amount_this_month", "comment": "The opportunity amount, if closed this month and status is pipeline."}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 21, "name": "pipeline_created_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is pipeline."}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 22, "name": "pipeline_created_forecast_amount_this_month", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline."}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 23, "name": "pipeline_created_forecast_amount_this_quarter", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline."}, "pipeline_count_created_this_month": {"type": "numeric", "index": 24, "name": "pipeline_count_created_this_month", "comment": "The opportunity count, if closed this month and status is pipeline."}, "pipeline_count_created_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_count_created_this_quarter", "comment": "The opportunity count, if closed this quarter and status is pipeline."}, "total_number_pipeline": {"type": "numeric", "index": 26, "name": "total_number_pipeline", "comment": "The opportunity count, if status is pipeline."}, "total_pipeline_amount": {"type": "numeric", "index": 27, "name": "total_pipeline_amount", "comment": "The opportunity amount, if status is pipeline."}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 28, "name": "total_pipeline_forecast_amount", "comment": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline."}, "largest_deal_in_pipeline": {"type": "numeric", "index": 29, "name": "largest_deal_in_pipeline", "comment": "The largest amount associated with a single opportunity in the current pipeline."}, "win_percent_this_month": {"type": "numeric", "index": 30, "name": "win_percent_this_month", "comment": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month."}, "win_percent_this_quarter": {"type": "numeric", "index": 31, "name": "win_percent_this_quarter", "comment": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter."}, "total_win_percent": {"type": "numeric", "index": 32, "name": "total_win_percent", "comment": "The booking amount closed, divided by the sum of the booking amount and the lost amount.."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__opportunity_daily_history", "database": "postgres", "comment": "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.", "owner": "postgres"}, "columns": {"opportunity_day_id": {"type": "text", "index": 1, "name": "opportunity_day_id", "comment": "Surrogate key hashed on `date_day` and `opportunity_id`"}, "date_day": {"type": "date", "index": 2, "name": "date_day", "comment": "Date on which the opportunity had these field values."}, "opportunity_id": {"type": "text", "index": 3, "name": "opportunity_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 4, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 5, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 6, "name": "_fivetran_date", "comment": null}, "history_unique_key": {"type": "text", "index": 7, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`."}, "_fivetran_active": {"type": "boolean", "index": 8, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 9, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_id": {"type": "text", "index": 10, "name": "account_id", "comment": "ID of the account associated with this opportunity."}, "amount": {"type": "double precision", "index": 11, "name": "amount", "comment": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products."}, "campaign_id": {"type": "integer", "index": 12, "name": "campaign_id", "comment": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled."}, "close_date": {"type": "timestamp without time zone", "index": 13, "name": "close_date", "comment": "Required. Date when the opportunity is expected to close."}, "created_date": {"type": "timestamp without time zone", "index": 14, "name": "created_date", "comment": "Date when the opportunity is was created."}, "description": {"type": "integer", "index": 15, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 16, "name": "expected_revenue", "comment": "Read-only field that is equal to the product of the opportunity Amount field and the Probability."}, "fiscal": {"type": "text", "index": 17, "name": "fiscal", "comment": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls."}, "fiscal_quarter": {"type": "integer", "index": 18, "name": "fiscal_quarter", "comment": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4."}, "fiscal_year": {"type": "integer", "index": 19, "name": "fiscal_year", "comment": "Represents the fiscal year, for example, 2006."}, "forecast_category": {"type": "text", "index": 20, "name": "forecast_category", "comment": "Restricted picklist field."}, "forecast_category_name": {"type": "text", "index": 21, "name": "forecast_category_name", "comment": "The name of the forecast category."}, "has_open_activity": {"type": "boolean", "index": 22, "name": "has_open_activity", "comment": "Indicates whether an opportunity has an open event or task (true) or not (false)."}, "has_opportunity_line_item": {"type": "boolean", "index": 23, "name": "has_opportunity_line_item", "comment": "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."}, "has_overdue_task": {"type": "boolean", "index": 24, "name": "has_overdue_task", "comment": "Indicates whether an opportunity has an overdue task (true) or not (false)."}, "is_closed": {"type": "boolean", "index": 25, "name": "is_closed", "comment": "True, if Stage Name Label is Closed."}, "is_deleted": {"type": "boolean", "index": 26, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "is_won": {"type": "boolean", "index": 27, "name": "is_won", "comment": "True, if Stage Name Label is Won."}, "last_activity_date": {"type": "timestamp without time zone", "index": 28, "name": "last_activity_date", "comment": "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."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": "Source of this opportunity, such as Advertisement or Trade Show."}, "name": {"type": "text", "index": 32, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 33, "name": "next_step", "comment": "Description of next task in closing opportunity."}, "owner_id": {"type": "text", "index": 34, "name": "owner_id", "comment": "ID of the User who has been assigned to work this opportunity."}, "probability": {"type": "integer", "index": 35, "name": "probability", "comment": "Percentage of estimated confidence in closing the opportunity."}, "record_type_id": {"type": "text", "index": 36, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "stage_name": {"type": "text", "index": 37, "name": "stage_name", "comment": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity."}, "synced_quote_id": {"type": "integer", "index": 38, "name": "synced_quote_id", "comment": "The ID of the Quote that syncs with the opportunity."}, "type": {"type": "text", "index": 39, "name": "type", "comment": "Type of opportunity. For example, Existing Business or New Business."}, "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": "public_salesforce_dev", "name": "salesforce__opportunity_enhanced", "database": "postgres", "comment": "This table both cleans and enhances your opportunities source table with information about the associate account and opportunity owner.\n", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": "ID of the account associated with this opportunity."}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products."}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled."}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": "Required. Date when the opportunity is expected to close."}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": "Date when the opportunity is was created."}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": "Text description of the opportunity."}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": "Read-only field that is equal to the product of the opportunity Amount field and the Probability."}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls."}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4."}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": "Represents the fiscal year, for example, 2006."}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": "The category of the state of the opportunity. Default values are 'pipeline','forecast','bestcase','closed', and 'omited'"}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": "The name of the forecast category."}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": "Indicates whether an opportunity has an open event or task (true) or not (false)."}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": "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."}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": "Indicates whether an opportunity has an overdue task (true) or not (false)."}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": "The unique, system-generated ID assigned during creation."}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": "True, if Stage Name Label is Closed."}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": "True, if Stage Name Label is Won."}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": "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."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": "Source of this opportunity, such as Advertisement or Trade Show."}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": "Required. A name for this opportunity."}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": "Description of next task in closing opportunity."}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": "Id of the owner of this opportunity"}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": "Percentage of estimated confidence in closing the opportunity."}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity."}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": "The ID of the Quote that syncs with the opportunity."}, "type": {"type": "text", "index": 32, "name": "type", "comment": "Type of opportunity. For example, Existing Business or New Business."}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": "Boolean field, indicating whether the created date is greater than or equal to the first day of this month."}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": "Boolean field, indicating whether the created date is greater than or equal to the first day of this quarter."}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": "The difference in days between the current day and the day the opportunity was created."}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": "The difference in days between the close day and the day the opportunity was created."}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": "Boolean field, indicating whether the closed month is equal to the current month."}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": "Boolean field, indicating whether the closed quarter is equal to the current quarter."}, "account_number": {"type": "text", "index": 39, "name": "account_number", "comment": "Number of the account associated with this opportunity."}, "account_source": {"type": "text", "index": 40, "name": "account_source", "comment": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "industry": {"type": "text", "index": 41, "name": "industry", "comment": "An industry associated with this account."}, "account_name": {"type": "text", "index": 42, "name": "account_name", "comment": "Name of the account."}, "number_of_employees": {"type": "integer", "index": 43, "name": "number_of_employees", "comment": "Number of employees working at the company represented by this account."}, "account_type": {"type": "text", "index": 44, "name": "account_type", "comment": "Type of account, for example, Customer, Competitor, or Partner."}, "opportunity_owner_id": {"type": "text", "index": 45, "name": "opportunity_owner_id", "comment": "ID of the User who has been assigned to work this opportunity."}, "opportunity_owner_name": {"type": "text", "index": 46, "name": "opportunity_owner_name", "comment": "The first and last name of the owner."}, "opportunity_owner_role_id": {"type": "text", "index": 47, "name": "opportunity_owner_role_id", "comment": "The ID associated with the owner's user role."}, "opportunity_owner_city": {"type": "text", "index": 48, "name": "opportunity_owner_city", "comment": "The city associated with the owner."}, "opportunity_owner_state": {"type": "text", "index": 49, "name": "opportunity_owner_state", "comment": "The state associated with the owner."}, "opportunity_manager_id": {"type": "text", "index": 50, "name": "opportunity_manager_id", "comment": "The Id of the user who manages this owner."}, "opportunity_manager_name": {"type": "text", "index": 51, "name": "opportunity_manager_name", "comment": "The name of the opportunity owner's manager."}, "opportunity_manager_city": {"type": "text", "index": 52, "name": "opportunity_manager_city", "comment": "The city associated with the owner's manager."}, "opportunity_manager_state": {"type": "text", "index": 53, "name": "opportunity_manager_state", "comment": "The state associated with the owner's manager."}, "opportunity_owner_position": {"type": "text", "index": 54, "name": "opportunity_owner_position", "comment": "Name of the position of the opportunity owner."}, "opportunity_owner_developer_name": {"type": "text", "index": 55, "name": "opportunity_owner_developer_name", "comment": "The name of the object of the opportunity owner."}, "opportunity_owner_parent_role_id": {"type": "text", "index": 56, "name": "opportunity_owner_parent_role_id", "comment": "The ID of the parent role of the opportunity owner."}, "opportunity_owner_rollup_description": {"type": "text", "index": 57, "name": "opportunity_owner_rollup_description", "comment": "Description of the forecast rollup of the opportunity owner.."}, "opportunity_record_type_name": {"type": "text", "index": 58, "name": "opportunity_record_type_name", "comment": "Name of the record type assigned to this opportunity. Only present if the record_type table is enabled."}, "status": {"type": "text", "index": 59, "name": "status", "comment": "Whether the opportunity is won, lost, in the pipeline, or other."}, "created_amount_this_month": {"type": "numeric", "index": 60, "name": "created_amount_this_month", "comment": "The opportunity amount, if created this month."}, "created_amount_this_quarter": {"type": "numeric", "index": 61, "name": "created_amount_this_quarter", "comment": "The opportunity amount, if created this quarter."}, "created_count_this_month": {"type": "integer", "index": 62, "name": "created_count_this_month", "comment": "The opportunity count, if created this month."}, "created_count_this_quarter": {"type": "integer", "index": 63, "name": "created_count_this_quarter", "comment": "The opportunity count, if created this quarter."}, "closed_amount_this_month": {"type": "numeric", "index": 64, "name": "closed_amount_this_month", "comment": "The opportunity amount, if closed this month."}, "closed_amount_this_quarter": {"type": "numeric", "index": 65, "name": "closed_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter."}, "closed_count_this_month": {"type": "integer", "index": 66, "name": "closed_count_this_month", "comment": "The opportunity count, if closed this month."}, "closed_count_this_quarter": {"type": "integer", "index": 67, "name": "closed_count_this_quarter", "comment": "The opportunity count, if closed this quarter."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__opportunity_line_item_enhanced", "database": "postgres", "comment": "Each record represents a line item belonging to a certain opportunity, with additional product details.", "owner": "postgres"}, "columns": {"opportunity_line_item_id": {"type": "text", "index": 1, "name": "opportunity_line_item_id", "comment": "Unique id for each record."}, "opportunity_line_item_name": {"type": "text", "index": 2, "name": "opportunity_line_item_name", "comment": "The unique name for each opportunity line item."}, "opportunity_line_item_description": {"type": "text", "index": 3, "name": "opportunity_line_item_description", "comment": "Text description of the opportunity line item."}, "opportunity_id": {"type": "text", "index": 4, "name": "opportunity_id", "comment": "ID of the associated Opportunity."}, "line_item_index": {"type": "bigint", "index": 5, "name": "line_item_index", "comment": "The index number of the specific line item, relative to all line items in that opportunity."}, "total_line_items": {"type": "bigint", "index": 6, "name": "total_line_items", "comment": "The total number of line items belonging to the same opportunity."}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": "Created date."}, "last_modified_date": {"type": "timestamp without time zone", "index": 8, "name": "last_modified_date", "comment": "Last Modified Date."}, "service_date": {"type": "timestamp without time zone", "index": 9, "name": "service_date", "comment": "Date when the product revenue will be recognized and the product quantity will be shipped. Opportunity Close Date\u2014ServiceDate is ignored."}, "pricebook_entry_id": {"type": "text", "index": 10, "name": "pricebook_entry_id", "comment": "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."}, "product_2_id": {"type": "text", "index": 11, "name": "product_2_id", "comment": "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."}, "list_price": {"type": "numeric(28,6)", "index": 12, "name": "list_price", "comment": "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."}, "quantity": {"type": "double precision", "index": 13, "name": "quantity", "comment": "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."}, "unit_price": {"type": "numeric(28,6)", "index": 14, "name": "unit_price", "comment": "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."}, "total_price": {"type": "numeric(28,6)", "index": 15, "name": "total_price", "comment": "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."}, "has_quantity_schedule": {"type": "boolean", "index": 16, "name": "has_quantity_schedule", "comment": "Indicates whether a quantity schedule has been created for this object (true) or not (false)."}, "has_revenue_schedule": {"type": "boolean", "index": 17, "name": "has_revenue_schedule", "comment": "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."}, "product_2_name": {"type": "text", "index": 18, "name": "product_2_name", "comment": "Default name of the product."}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": "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."}, "product_2_description": {"type": "text", "index": 20, "name": "product_2_description", "comment": "A text description of the product."}, "product_external_id": {"type": "text", "index": 21, "name": "product_external_id", "comment": "The unique identifier of the product in the linked external data source. For example, ID #123."}, "product_family": {"type": "text", "index": 22, "name": "product_family", "comment": "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."}, "product_is_active": {"type": "boolean", "index": 23, "name": "product_is_active", "comment": "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."}, "product_is_archived": {"type": "boolean", "index": 24, "name": "product_is_archived", "comment": "Describes whether the product is archived. The default value is false."}, "product_is_deleted": {"type": "boolean", "index": 25, "name": "product_is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "product_number_of_quantity_installments": {"type": "integer", "index": 26, "name": "product_number_of_quantity_installments", "comment": "If the product has a quantity schedule, the number of installments."}, "product_quantity_installment_period": {"type": "text", "index": 27, "name": "product_quantity_installment_period", "comment": "If the product has a quantity schedule, the amount of time covered by the schedule."}, "product_quantity_schedule_type": {"type": "text", "index": 28, "name": "product_quantity_schedule_type", "comment": "The type of the quantity schedule, if the product has one."}, "product_quantity_unit_of_measure": {"type": "text", "index": 29, "name": "product_quantity_unit_of_measure", "comment": "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."}, "product_number_of_revenue_installments": {"type": "integer", "index": 30, "name": "product_number_of_revenue_installments", "comment": "If the product has a revenue schedule, the number of installments."}, "product_revenue_installment_period": {"type": "text", "index": 31, "name": "product_revenue_installment_period", "comment": "If the product has a revenue schedule, the time period covered by the schedule."}, "product_revenue_schedule_type": {"type": "text", "index": 32, "name": "product_revenue_schedule_type", "comment": "The type of the revenue schedule, if the product has one."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__owner_performance", "database": "postgres", "comment": "Each record represents an individual member of the sales team, enriched with data about their pipeline, bookings, loses, and win percentages.", "owner": "postgres"}, "columns": {"owner_id": {"type": "text", "index": 1, "name": "owner_id", "comment": "Id of the owner of this opportunity"}, "manager_id": {"type": "text", "index": 2, "name": "manager_id", "comment": "Manager ID associated with opportunities."}, "b_manager_id": {"type": "text", "index": 3, "name": "b_manager_id", "comment": "Manager ID of the booking_by_owner CTE. Helper field."}, "b_owner_id": {"type": "text", "index": 4, "name": "b_owner_id", "comment": "Owner ID of the booking_by_owner CTE. Helper field."}, "bookings_amount_closed_this_month": {"type": "numeric", "index": 5, "name": "bookings_amount_closed_this_month", "comment": "The opportunity amount, if closed this month and status is won."}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 6, "name": "bookings_amount_closed_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is won."}, "total_number_bookings": {"type": "bigint", "index": 7, "name": "total_number_bookings", "comment": "The opportunity count, if status is won."}, "total_bookings_amount": {"type": "numeric", "index": 8, "name": "total_bookings_amount", "comment": "The opportunity amount, if status is won."}, "bookings_count_closed_this_month": {"type": "bigint", "index": 9, "name": "bookings_count_closed_this_month", "comment": "The opportunity count, if closed this month and status is won."}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 10, "name": "bookings_count_closed_this_quarter", "comment": "The opportunity count, if closed this quarter and status is won."}, "avg_bookings_amount": {"type": "numeric", "index": 11, "name": "avg_bookings_amount", "comment": "The average opportunity amount, if status is won."}, "largest_booking": {"type": "numeric", "index": 12, "name": "largest_booking", "comment": "The largest amount associated with a single opportunity."}, "avg_days_to_close": {"type": "numeric", "index": 13, "name": "avg_days_to_close", "comment": "The average days to close across opportunties in that have been won."}, "l_manager_id": {"type": "text", "index": 14, "name": "l_manager_id", "comment": "Manager ID of the lost_by_owner CTE. Helper field."}, "l_owner_id": {"type": "text", "index": 15, "name": "l_owner_id", "comment": "Owner ID of the lost_by_owner CTE. Helper field."}, "lost_amount_this_month": {"type": "numeric", "index": 16, "name": "lost_amount_this_month", "comment": "The opportunity amount, if closed this month and status is lost."}, "lost_amount_this_quarter": {"type": "numeric", "index": 17, "name": "lost_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is lost."}, "total_number_lost": {"type": "bigint", "index": 18, "name": "total_number_lost", "comment": "The opportunity count, if status is lost."}, "total_lost_amount": {"type": "numeric", "index": 19, "name": "total_lost_amount", "comment": "The opportunity amount, if status is lost."}, "lost_count_this_month": {"type": "bigint", "index": 20, "name": "lost_count_this_month", "comment": "The opportunity count, if closed this month and status is lost."}, "lost_count_this_quarter": {"type": "bigint", "index": 21, "name": "lost_count_this_quarter", "comment": "The opportunity count, if closed this quarter and status is lost."}, "p_manager_id": {"type": "text", "index": 22, "name": "p_manager_id", "comment": "Manager ID of the pipeline_by_owner CTE. Helper field."}, "p_owner_id": {"type": "text", "index": 23, "name": "p_owner_id", "comment": "Owner ID of the pipeline_by_owner CTE. Helper field."}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 24, "name": "pipeline_created_amount_this_month", "comment": "The opportunity amount, if closed this month and status is pipeline."}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 25, "name": "pipeline_created_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is pipeline."}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 26, "name": "pipeline_created_forecast_amount_this_month", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline."}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 27, "name": "pipeline_created_forecast_amount_this_quarter", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline."}, "pipeline_count_created_this_month": {"type": "bigint", "index": 28, "name": "pipeline_count_created_this_month", "comment": "The opportunity count, if closed this month and status is pipeline."}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 29, "name": "pipeline_count_created_this_quarter", "comment": "The opportunity count, if closed this quarter and status is pipeline."}, "total_number_pipeline": {"type": "bigint", "index": 30, "name": "total_number_pipeline", "comment": "The opportunity count, if status is pipeline."}, "total_pipeline_amount": {"type": "numeric", "index": 31, "name": "total_pipeline_amount", "comment": "The opportunity amount, if status is pipeline."}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 32, "name": "total_pipeline_forecast_amount", "comment": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline."}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 33, "name": "avg_pipeline_opp_amount", "comment": "The average opportunity amount, if status is pipeline."}, "largest_deal_in_pipeline": {"type": "numeric", "index": 34, "name": "largest_deal_in_pipeline", "comment": "The largest amount associated with a single opportunity in the current pipeline."}, "avg_days_open": {"type": "numeric", "index": 35, "name": "avg_days_open", "comment": "The average days since created across opportunties in the pipeline."}, "owner_name": {"type": "text", "index": 36, "name": "owner_name", "comment": "The first and last name of the owner."}, "owner_city": {"type": "text", "index": 37, "name": "owner_city", "comment": "The city associated with the owner."}, "owner_state": {"type": "text", "index": 38, "name": "owner_state", "comment": "The state associated with the owner."}, "win_percent_this_month": {"type": "numeric", "index": 39, "name": "win_percent_this_month", "comment": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month."}, "win_percent_this_quarter": {"type": "numeric", "index": 40, "name": "win_percent_this_quarter", "comment": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter."}, "total_win_percent": {"type": "numeric", "index": 41, "name": "total_win_percent", "comment": "The booking amount closed, divided by the sum of the booking amount and the lost amount.."}}, "stats": {"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": "public_salesforce_dev", "name": "salesforce__sales_snapshot", "database": "postgres", "comment": "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", "owner": "postgres"}, "columns": {"bookings_amount_closed_this_month": {"type": "numeric", "index": 1, "name": "bookings_amount_closed_this_month", "comment": "The opportunity amount, if closed this month and status is won."}, "bookings_amount_closed_this_quarter": {"type": "numeric", "index": 2, "name": "bookings_amount_closed_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is won."}, "total_number_bookings": {"type": "bigint", "index": 3, "name": "total_number_bookings", "comment": "The opportunity count, if status is won."}, "total_bookings_amount": {"type": "numeric", "index": 4, "name": "total_bookings_amount", "comment": "The opportunity amount, if status is won."}, "bookings_count_closed_this_month": {"type": "bigint", "index": 5, "name": "bookings_count_closed_this_month", "comment": "The opportunity count, if closed this month and status is won."}, "bookings_count_closed_this_quarter": {"type": "bigint", "index": 6, "name": "bookings_count_closed_this_quarter", "comment": "The opportunity count, if closed this quarter and status is won."}, "avg_bookings_amount": {"type": "numeric", "index": 7, "name": "avg_bookings_amount", "comment": "The average opportunity amount, if status is won."}, "largest_booking": {"type": "numeric", "index": 8, "name": "largest_booking", "comment": "The largest amount associated with a single opportunity."}, "avg_days_to_close": {"type": "numeric", "index": 9, "name": "avg_days_to_close", "comment": "The average days to close across opportunties in that have been won."}, "pipeline_created_amount_this_month": {"type": "numeric", "index": 10, "name": "pipeline_created_amount_this_month", "comment": "The opportunity amount, if closed this month and status is pipeline."}, "pipeline_created_amount_this_quarter": {"type": "numeric", "index": 11, "name": "pipeline_created_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is pipeline."}, "pipeline_created_forecast_amount_this_month": {"type": "double precision", "index": 12, "name": "pipeline_created_forecast_amount_this_month", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this month and status is pipeline."}, "pipeline_created_forecast_amount_this_quarter": {"type": "double precision", "index": 13, "name": "pipeline_created_forecast_amount_this_quarter", "comment": "The opportunity amount mulitplied by the forecast percentage, if closed this quarter and status is pipeline."}, "pipeline_count_created_this_month": {"type": "bigint", "index": 14, "name": "pipeline_count_created_this_month", "comment": "The opportunity count, if closed this month and status is pipeline."}, "pipeline_count_created_this_quarter": {"type": "bigint", "index": 15, "name": "pipeline_count_created_this_quarter", "comment": "The opportunity count, if closed this quarter and status is pipeline."}, "total_number_pipeline": {"type": "bigint", "index": 16, "name": "total_number_pipeline", "comment": "The opportunity count, if status is pipeline."}, "total_pipeline_amount": {"type": "numeric", "index": 17, "name": "total_pipeline_amount", "comment": "The opportunity amount, if status is pipeline."}, "total_pipeline_forecast_amount": {"type": "double precision", "index": 18, "name": "total_pipeline_forecast_amount", "comment": "The opportunity amount mulitplied by the forecast percentage, if status is pipeline."}, "avg_pipeline_opp_amount": {"type": "numeric", "index": 19, "name": "avg_pipeline_opp_amount", "comment": "The average opportunity amount, if status is pipeline."}, "largest_deal_in_pipeline": {"type": "numeric", "index": 20, "name": "largest_deal_in_pipeline", "comment": "The largest amount associated with a single opportunity in the current pipeline."}, "avg_days_open": {"type": "numeric", "index": 21, "name": "avg_days_open", "comment": "The average days since created across opportunties in the pipeline."}, "lost_amount_this_month": {"type": "numeric", "index": 22, "name": "lost_amount_this_month", "comment": "The opportunity amount, if closed this month and status is lost."}, "lost_amount_this_quarter": {"type": "numeric", "index": 23, "name": "lost_amount_this_quarter", "comment": "The opportunity amount, if closed this quarter and status is lost."}, "total_number_lost": {"type": "bigint", "index": 24, "name": "total_number_lost", "comment": "The opportunity count, if status is lost."}, "total_lost_amount": {"type": "numeric", "index": 25, "name": "total_lost_amount", "comment": "The opportunity amount, if status is lost."}, "lost_count_this_month": {"type": "bigint", "index": 26, "name": "lost_count_this_month", "comment": "The opportunity count, if closed this month and status is lost."}, "lost_count_this_quarter": {"type": "bigint", "index": 27, "name": "lost_count_this_quarter", "comment": "The opportunity count, if closed this quarter and status is lost."}, "win_percent_this_month": {"type": "numeric", "index": 28, "name": "win_percent_this_month", "comment": "The booking amount closed this month, divided by the sum of the booking amount closed this month and the lost amount this month."}, "win_percent_this_quarter": {"type": "numeric", "index": 29, "name": "win_percent_this_quarter", "comment": "The booking amount closed this quarter, divided by the sum of the booking amount closed this quarter and the lost amount this quarter."}, "total_win_percent": {"type": "numeric", "index": 30, "name": "total_win_percent", "comment": "The booking amount closed, divided by the sum of the booking amount and the lost amount.."}}, "stats": {"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.stg_salesforce__account": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__account", "database": "postgres", "comment": "Represents an individual account, which is an organization or person involved with your business (such as customers, competitors, and partners).", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "account_number": {"type": "text", "index": 2, "name": "account_number", "comment": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "account_source": {"type": "text", "index": 3, "name": "account_source", "comment": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "annual_revenue": {"type": "numeric(28,6)", "index": 4, "name": "annual_revenue", "comment": "Estimated annual revenue of the account."}, "billing_city": {"type": "text", "index": 5, "name": "billing_city", "comment": "Details for the billing address of this account."}, "billing_country": {"type": "text", "index": 6, "name": "billing_country", "comment": "Details for the billing address of this account."}, "billing_postal_code": {"type": "text", "index": 7, "name": "billing_postal_code", "comment": "Details for the billing address of this account."}, "billing_state": {"type": "text", "index": 8, "name": "billing_state", "comment": "Details for the billing address of this account."}, "billing_state_code": {"type": "text", "index": 9, "name": "billing_state_code", "comment": "The ISO state code for the account\u2019s billing address."}, "billing_street": {"type": "text", "index": 10, "name": "billing_street", "comment": "Street address for the billing address of this account."}, "account_description": {"type": "text", "index": 11, "name": "account_description", "comment": "Text description of the account."}, "account_id": {"type": "text", "index": 12, "name": "account_id", "comment": "The unique, system-generated ID assigned during creation"}, "industry": {"type": "text", "index": 13, "name": "industry", "comment": "An industry associated with this account."}, "is_deleted": {"type": "boolean", "index": 14, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "last_activity_date": {"type": "timestamp without time zone", "index": 15, "name": "last_activity_date", "comment": "Value is one of the following, whichever is the most recent"}, "last_referenced_date": {"type": "timestamp without time zone", "index": 16, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": "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."}, "master_record_id": {"type": "text", "index": 18, "name": "master_record_id", "comment": "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."}, "account_name": {"type": "text", "index": 19, "name": "account_name", "comment": "Required. Name of the account."}, "number_of_employees": {"type": "integer", "index": 20, "name": "number_of_employees", "comment": "Number of employees working at the company represented by this account."}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": "The ID of the user who currently owns this account."}, "ownership": {"type": "text", "index": 22, "name": "ownership", "comment": "Ownership type for the account, for example Private, Public, or Subsidiary."}, "parent_id": {"type": "text", "index": 23, "name": "parent_id", "comment": "ID of the parent object, if any."}, "rating": {"type": "text", "index": 24, "name": "rating", "comment": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "record_type_id": {"type": "text", "index": 25, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "shipping_city": {"type": "text", "index": 26, "name": "shipping_city", "comment": "Details of the shipping address for this account"}, "shipping_country": {"type": "text", "index": 27, "name": "shipping_country", "comment": "Details of the shipping address for this account. Country"}, "shipping_country_code": {"type": "text", "index": 28, "name": "shipping_country_code", "comment": "The ISO country code for the account\u2019s shipping address."}, "shipping_postal_code": {"type": "text", "index": 29, "name": "shipping_postal_code", "comment": "Details of the shipping address for this account. Postal code"}, "shipping_state": {"type": "text", "index": 30, "name": "shipping_state", "comment": "Details of the shipping address for this account. State"}, "shipping_state_code": {"type": "text", "index": 31, "name": "shipping_state_code", "comment": "The ISO state code for the account\u2019s shipping address."}, "shipping_street": {"type": "text", "index": 32, "name": "shipping_street", "comment": "The street address of the shipping address for this account."}, "type": {"type": "text", "index": 33, "name": "type", "comment": "Type of account, for example, Customer, Competitor, or Partner."}, "website": {"type": "text", "index": 34, "name": "website", "comment": "The website of this account."}}, "stats": {"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.stg_salesforce__account"}, "model.salesforce.stg_salesforce__account_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__account_history", "database": "postgres", "comment": "Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners).", "owner": "postgres"}, "columns": {"account_id": {"type": "text", "index": 1, "name": "account_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": "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."}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `account_id`."}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_number": {"type": "integer", "index": 8, "name": "account_number", "comment": "Account number assigned to this account (not the unique, system-generated ID assigned during creation)."}, "account_source": {"type": "text", "index": 9, "name": "account_source", "comment": "The source of the account record. For example, Advertisement, Data.com, or Trade Show."}, "annual_revenue": {"type": "double precision", "index": 10, "name": "annual_revenue", "comment": "Estimated annual revenue of the account."}, "billing_city": {"type": "text", "index": 11, "name": "billing_city", "comment": "Details for the billing address of this account."}, "billing_country": {"type": "text", "index": 12, "name": "billing_country", "comment": "Details for the billing address of this account."}, "billing_postal_code": {"type": "text", "index": 13, "name": "billing_postal_code", "comment": "Details for the billing address of this account."}, "billing_state": {"type": "text", "index": 14, "name": "billing_state", "comment": "Details for the billing address of this account."}, "billing_street": {"type": "text", "index": 15, "name": "billing_street", "comment": "Street address for the billing address of this account."}, "description": {"type": "text", "index": 16, "name": "description", "comment": null}, "industry": {"type": "text", "index": 17, "name": "industry", "comment": "An industry associated with this account."}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "last_activity_date": {"type": "timestamp without time zone", "index": 19, "name": "last_activity_date", "comment": "Value is one of the following, whichever is the most recent."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 20, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 21, "name": "last_viewed_date", "comment": "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."}, "master_record_id": {"type": "text", "index": 22, "name": "master_record_id", "comment": "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."}, "name": {"type": "text", "index": 23, "name": "name", "comment": null}, "number_of_employees": {"type": "integer", "index": 24, "name": "number_of_employees", "comment": "Number of employees working at the company represented by this account."}, "owner_id": {"type": "text", "index": 25, "name": "owner_id", "comment": "The ID of the user who currently owns this account."}, "ownership": {"type": "integer", "index": 26, "name": "ownership", "comment": "Ownership type for the account, for example Private, Public, or Subsidiary."}, "parent_id": {"type": "integer", "index": 27, "name": "parent_id", "comment": "ID of the parent object, if any."}, "rating": {"type": "integer", "index": 28, "name": "rating", "comment": "The account\u2019s prospect rating, for example Hot, Warm, or Cold."}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "shipping_city": {"type": "integer", "index": 30, "name": "shipping_city", "comment": "Details of the shipping address for this account."}, "shipping_country": {"type": "text", "index": 31, "name": "shipping_country", "comment": "Details of the shipping address for this account. Country."}, "shipping_postal_code": {"type": "integer", "index": 32, "name": "shipping_postal_code", "comment": "Details of the shipping address for this account. Postal code."}, "shipping_state": {"type": "integer", "index": 33, "name": "shipping_state", "comment": "Details of the shipping address for this account. State."}, "shipping_street": {"type": "integer", "index": 34, "name": "shipping_street", "comment": "The street address of the shipping address for this account."}, "type": {"type": "text", "index": 35, "name": "type", "comment": "Type of account, for example, Customer, Competitor, or Partner."}, "website": {"type": "text", "index": 36, "name": "website", "comment": "The website of this account."}}, "stats": {"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.stg_salesforce__account_history"}, "model.salesforce.stg_salesforce__campaign": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__campaign", "database": "postgres", "comment": "Represents a marketing campaign, such as a direct mail promotion, webinar, or trade show.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "campaign_id": {"type": "text", "index": 2, "name": "campaign_id", "comment": "The unique, system-generated ID assigned during creation."}, "actual_cost": {"type": "numeric(28,6)", "index": 3, "name": "actual_cost", "comment": "Amount of money spent to run the campaign."}, "total_pipeline_amount": {"type": "numeric(28,6)", "index": 4, "name": "total_pipeline_amount", "comment": "Total amount of all opportunities associated with the campaign."}, "budgeted_cost": {"type": "numeric(28,6)", "index": 5, "name": "budgeted_cost", "comment": "Amount of money budgeted for the campaign."}, "campaign_member_record_type_id": {"type": "text", "index": 6, "name": "campaign_member_record_type_id", "comment": "ID of the record type assigned to campaign members of this campaign."}, "campaign_description": {"type": "text", "index": 7, "name": "campaign_description", "comment": "Description of the campaign."}, "end_date": {"type": "timestamp without time zone", "index": 8, "name": "end_date", "comment": "Ending date for the campaign."}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": "Indicates whether the campaign is active (true) or not (false)."}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "campaign_name": {"type": "text", "index": 11, "name": "campaign_name", "comment": "Required. Name of the campaign."}, "number_of_contacts": {"type": "integer", "index": 12, "name": "number_of_contacts", "comment": "Number of contacts associated with the campaign."}, "number_of_converted_leads": {"type": "integer", "index": 13, "name": "number_of_converted_leads", "comment": "Number of leads associated with the campaign that have been converted."}, "number_of_leads": {"type": "integer", "index": 14, "name": "number_of_leads", "comment": "Number of leads associated with the campaign."}, "number_of_opportunities": {"type": "integer", "index": 15, "name": "number_of_opportunities", "comment": "Number of opportunities associated with the campaign."}, "number_of_responses": {"type": "integer", "index": 16, "name": "number_of_responses", "comment": "Number of contacts and leads that have a campaign member status where the Has Responded field is true."}, "number_of_won_opportunities": {"type": "integer", "index": 17, "name": "number_of_won_opportunities", "comment": "Number of opportunities associated with the campaign that have a probability of 100% because they are closed and won."}, "parent_campaign_id": {"type": "text", "index": 18, "name": "parent_campaign_id", "comment": "The ID of the parent campaign, if applicable."}, "start_date": {"type": "timestamp without time zone", "index": 19, "name": "start_date", "comment": "Starting date for the campaign."}, "campaign_status": {"type": "text", "index": 20, "name": "campaign_status", "comment": "Status of the campaign, such as Planned, In Progress, or Completed."}, "campaign_type": {"type": "text", "index": 21, "name": "campaign_type", "comment": "Type of campaign, such as Direct Mail, Email, or Webinar."}}, "stats": {"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.stg_salesforce__campaign"}, "model.salesforce.stg_salesforce__campaign_member": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__campaign_member", "database": "postgres", "comment": "Represents the relationship between a campaign and either a lead or a contact.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "campaign_member_id": {"type": "text", "index": 2, "name": "campaign_member_id", "comment": "The unique, system-generated ID assigned during creation."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "ID of the account associated with the contact or lead."}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": "ID of the campaign."}, "contact_id": {"type": "text", "index": 5, "name": "contact_id", "comment": "ID of the contact associated with this campaign member."}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": "ID of the user who created the campaign member record."}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": "Date when the campaign member record was created."}, "first_responded_date": {"type": "timestamp without time zone", "index": 8, "name": "first_responded_date", "comment": "Date when the contact or lead first responded to the campaign."}, "has_opted_out_of_email": {"type": "boolean", "index": 9, "name": "has_opted_out_of_email", "comment": "Indicates whether the contact or lead has opted out of email communications."}, "has_responded": {"type": "boolean", "index": 10, "name": "has_responded", "comment": "Indicates whether the contact or lead has responded to the campaign."}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": "ID of the user who last modified the campaign member record."}, "lead_id": {"type": "text", "index": 13, "name": "lead_id", "comment": "ID of the lead associated with this campaign member."}, "lead_or_contact_id": {"type": "text", "index": 14, "name": "lead_or_contact_id", "comment": "ID of the lead or contact associated with this campaign member."}, "lead_or_contact_owner_id": {"type": "text", "index": 15, "name": "lead_or_contact_owner_id", "comment": "ID of the owner of the lead or contact associated with this campaign member."}, "status": {"type": "text", "index": 16, "name": "status", "comment": "The status of the campaign member, such as Sent or Responded."}}, "stats": {"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.stg_salesforce__campaign_member"}, "model.salesforce.stg_salesforce__contact": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact", "database": "postgres", "comment": "Represents a contact, which is a person associated with an account.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "contact_id": {"type": "text", "index": 2, "name": "contact_id", "comment": "The unique, system-generated ID assigned during creation."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "ID of the account that\u2019s the parent of this contact."}, "department": {"type": "text", "index": 4, "name": "department", "comment": "The contact\u2019s department."}, "contact_description": {"type": "text", "index": 5, "name": "contact_description", "comment": "A description of the contact. Label is Contact Description up to 32 KB."}, "email": {"type": "text", "index": 6, "name": "email", "comment": "The contact\u2019s email address."}, "first_name": {"type": "text", "index": 7, "name": "first_name", "comment": "The contact\u2019s first name up to 40 characters."}, "home_phone": {"type": "text", "index": 8, "name": "home_phone", "comment": "The contact\u2019s home telephone number."}, "individual_id": {"type": "text", "index": 9, "name": "individual_id", "comment": "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."}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "last_activity_date": {"type": "timestamp without time zone", "index": 11, "name": "last_activity_date", "comment": "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"}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_name": {"type": "text", "index": 14, "name": "last_name", "comment": "Required. Last name of the contact up to 80 characters."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 15, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 16, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 17, "name": "lead_source", "comment": "The lead\u2019s source."}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": "Mailing address details."}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": "Mailing address details."}, "mailing_country_code": {"type": "text", "index": 20, "name": "mailing_country_code", "comment": "The ISO codes for the mailing address\u2019s state and country."}, "mailing_postal_code": {"type": "text", "index": 21, "name": "mailing_postal_code", "comment": "Mailing address details."}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": "Mailing address details."}, "mailing_state_code": {"type": "text", "index": 23, "name": "mailing_state_code", "comment": "The ISO codes for the mailing address\u2019s state and country."}, "mailing_street": {"type": "text", "index": 24, "name": "mailing_street", "comment": "Street address for mailing address."}, "master_record_id": {"type": "text", "index": 25, "name": "master_record_id", "comment": "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"}, "mobile_phone": {"type": "text", "index": 26, "name": "mobile_phone", "comment": "Contact\u2019s mobile phone number."}, "contact_name": {"type": "text", "index": 27, "name": "contact_name", "comment": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces."}, "owner_id": {"type": "text", "index": 28, "name": "owner_id", "comment": "The ID of the owner of the account associated with this contact. This is a relationship field.\n"}, "phone": {"type": "text", "index": 29, "name": "phone", "comment": "Telephone number for the contact. Label is Business Phone."}, "reports_to_id": {"type": "text", "index": 30, "name": "reports_to_id", "comment": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n"}, "title": {"type": "text", "index": 31, "name": "title", "comment": "Title"}}, "stats": {"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.stg_salesforce__contact"}, "model.salesforce.stg_salesforce__contact_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact_history", "database": "postgres", "comment": "Represents the historical record of contacts, which are people associated with an account.", "owner": "postgres"}, "columns": {"contact_id": {"type": "text", "index": 1, "name": "contact_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": "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."}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `contact_id`."}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": "ID of the account that\u2019s the parent of this contact."}, "email": {"type": "text", "index": 9, "name": "email", "comment": "The contact\u2019s email address."}, "first_name": {"type": "text", "index": 10, "name": "first_name", "comment": "The contact\u2019s first name up to 40 characters."}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "last_activity_date": {"type": "timestamp without time zone", "index": 12, "name": "last_activity_date", "comment": "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"}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 14, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_name": {"type": "text", "index": 15, "name": "last_name", "comment": "Required. Last name of the contact up to 80 characters."}, "last_referenced_date": {"type": "integer", "index": 16, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 17, "name": "last_viewed_date", "comment": "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."}, "mailing_city": {"type": "text", "index": 18, "name": "mailing_city", "comment": "City mailing address details."}, "mailing_country": {"type": "text", "index": 19, "name": "mailing_country", "comment": "Country mailing address details."}, "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": "Postal code mailing address details."}, "mailing_state": {"type": "text", "index": 22, "name": "mailing_state", "comment": "State mailing address details."}, "mailing_street": {"type": "text", "index": 23, "name": "mailing_street", "comment": "Street mailing address details."}, "master_record_id": {"type": "integer", "index": 24, "name": "master_record_id", "comment": "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"}, "mobile_phone": {"type": "integer", "index": 25, "name": "mobile_phone", "comment": "Contact\u2019s mobile phone number."}, "name": {"type": "text", "index": 26, "name": "name", "comment": null}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": "The ID of the owner of the account associated with this contact. This is a relationship field.\n"}, "phone": {"type": "text", "index": 28, "name": "phone", "comment": "Telephone number for the contact. Label is Business Phone."}, "reports_to_id": {"type": "integer", "index": 29, "name": "reports_to_id", "comment": "This field doesn\u2019t appear if IsPersonAccount is true. This is a relationship field.\n"}, "title": {"type": "text", "index": 30, "name": "title", "comment": "Title"}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": "The lead\u2019s source."}, "description": {"type": "text", "index": 32, "name": "description", "comment": null}, "individual_id": {"type": "integer", "index": 33, "name": "individual_id", "comment": "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."}, "home_phone": {"type": "integer", "index": 34, "name": "home_phone", "comment": "The contact\u2019s home telephone number."}}, "stats": {"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.stg_salesforce__contact_history"}, "model.salesforce.stg_salesforce__event": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__event", "database": "postgres", "comment": "Represents an event in the calendar. In the user interface, event and task records are collectively referred to as activities.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "event_id": {"type": "text", "index": 2, "name": "event_id", "comment": "The unique, system-generated ID assigned during creation."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "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"}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": "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"}, "activity_date_time": {"type": "timestamp without time zone", "index": 5, "name": "activity_date_time", "comment": "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"}, "created_by_id": {"type": "text", "index": 6, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 7, "name": "created_date", "comment": "Created Date"}, "event_description": {"type": "text", "index": 8, "name": "event_description", "comment": "Contains a text description of the event."}, "end_date": {"type": "timestamp without time zone", "index": 9, "name": "end_date", "comment": "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."}, "end_date_time": {"type": "timestamp without time zone", "index": 10, "name": "end_date_time", "comment": "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."}, "event_subtype": {"type": "text", "index": 11, "name": "event_subtype", "comment": "Provides standard subtypes to facilitate creating and searching for events. This field isn\u2019t updateable."}, "group_event_type": {"type": "text", "index": 12, "name": "group_event_type", "comment": "Group Event Type"}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": "Indicates whether the event has been archived."}, "is_child": {"type": "boolean", "index": 14, "name": "is_child", "comment": "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."}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": "Deleted"}, "is_group_event": {"type": "boolean", "index": 16, "name": "is_group_event", "comment": "Indicates whether the event is a group event\u2014that is, whether it has invitees (true) or not (false)."}, "is_recurrence": {"type": "boolean", "index": 17, "name": "is_recurrence", "comment": "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."}, "last_modified_by_id": {"type": "text", "index": 18, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 19, "name": "last_modified_date", "comment": "Last Modified Date"}, "location": {"type": "text", "index": 20, "name": "location", "comment": "Contains the location of the event."}, "owner_id": {"type": "text", "index": 21, "name": "owner_id", "comment": "Contains the ID of the user or public calendar who owns the event. Label is Assigned to ID. This is a polymorphic relationship field."}, "start_date_time": {"type": "timestamp without time zone", "index": 22, "name": "start_date_time", "comment": "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"}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": "The subject line of the event, such as Call, Email, or Meeting."}, "type": {"type": "text", "index": 24, "name": "type", "comment": "Indicates the event type, such as Call, Email, or Meeting."}, "what_count": {"type": "integer", "index": 25, "name": "what_count", "comment": "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."}, "what_id": {"type": "text", "index": 26, "name": "what_id", "comment": "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."}, "who_count": {"type": "integer", "index": 27, "name": "who_count", "comment": "Available to organizations that have Shared Activities enabled. Represents the count of related EventRelations pertaining to the WhoId."}, "who_id": {"type": "text", "index": 28, "name": "who_id", "comment": "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"}}, "stats": {"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.stg_salesforce__event"}, "model.salesforce.stg_salesforce__lead": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__lead", "database": "postgres", "comment": "Represents a prospect or lead.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "lead_id": {"type": "text", "index": 2, "name": "lead_id", "comment": "The unique, system-generated ID assigned during creation."}, "annual_revenue": {"type": "numeric(28,6)", "index": 3, "name": "annual_revenue", "comment": "Annual revenue for the lead\u2019s company."}, "city": {"type": "text", "index": 4, "name": "city", "comment": "City for the lead\u2019s address."}, "company": {"type": "text", "index": 5, "name": "company", "comment": "Required. The lead\u2019s company."}, "converted_account_id": {"type": "text", "index": 6, "name": "converted_account_id", "comment": "Object reference ID that points to the account into which the lead converted. This is a relationship field."}, "converted_contact_id": {"type": "text", "index": 7, "name": "converted_contact_id", "comment": "Object reference ID that points to the contact into which the lead converted. This is a relationship field."}, "converted_date": {"type": "timestamp without time zone", "index": 8, "name": "converted_date", "comment": "Date on which this lead was converted."}, "converted_opportunity_id": {"type": "text", "index": 9, "name": "converted_opportunity_id", "comment": "Object reference ID that points to the opportunity into which the lead has been converted. This is a relationship field."}, "country": {"type": "text", "index": 10, "name": "country", "comment": "The lead\u2019s country."}, "country_code": {"type": "text", "index": 11, "name": "country_code", "comment": "The ISO country code for the lead\u2019s address."}, "created_by_id": {"type": "text", "index": 12, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 13, "name": "created_date", "comment": "Created Date"}, "lead_description": {"type": "text", "index": 14, "name": "lead_description", "comment": "The lead\u2019s description."}, "email": {"type": "text", "index": 15, "name": "email", "comment": "The lead\u2019s email address."}, "email_bounced_date": {"type": "timestamp without time zone", "index": 16, "name": "email_bounced_date", "comment": "If bounce management is activated and an email sent to the lead bounced, the date and time of the bounce."}, "email_bounced_reason": {"type": "text", "index": 17, "name": "email_bounced_reason", "comment": "If bounce management is activated and an email sent to the lead bounced, the reason for the bounce."}, "first_name": {"type": "text", "index": 18, "name": "first_name", "comment": "The lead\u2019s first name up to 40 characters."}, "has_opted_out_of_email": {"type": "boolean", "index": 19, "name": "has_opted_out_of_email", "comment": "Indicates whether the lead doesn\u2019t want to receive email from Salesforce (true) or does (false). Label is Email Opt Out."}, "individual_id": {"type": "text", "index": 20, "name": "individual_id", "comment": "ID of the data privacy record associated with this lead. This field is available if you enabled Data Protection and Privacy in Setup."}, "industry": {"type": "text", "index": 21, "name": "industry", "comment": "Industry in which the lead works."}, "is_converted": {"type": "boolean", "index": 22, "name": "is_converted", "comment": "Indicates whether the lead has been converted (true) or not (false). Label is Converted."}, "is_deleted": {"type": "boolean", "index": 23, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "is_unread_by_owner": {"type": "boolean", "index": 24, "name": "is_unread_by_owner", "comment": "If true, lead has been assigned, but not yet viewed. See Unread Leads for more information. Label is Unread By Owner."}, "last_activity_date": {"type": "timestamp without time zone", "index": 25, "name": "last_activity_date", "comment": "'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"}, "last_modified_by_id": {"type": "text", "index": 26, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 27, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_name": {"type": "text", "index": 28, "name": "last_name", "comment": "Required. Last name of the lead up to 80 characters."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 29, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 30, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 31, "name": "lead_source", "comment": "The lead\u2019s source."}, "master_record_id": {"type": "text", "index": 32, "name": "master_record_id", "comment": "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."}, "mobile_phone": {"type": "text", "index": 33, "name": "mobile_phone", "comment": "The lead\u2019s mobile phone number."}, "lead_name": {"type": "text", "index": 34, "name": "lead_name", "comment": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces."}, "number_of_employees": {"type": "integer", "index": 35, "name": "number_of_employees", "comment": "Number of employees at the lead\u2019s company. Label is Employees."}, "owner_id": {"type": "text", "index": 36, "name": "owner_id", "comment": "ID of the lead\u2019s owner. This is a polymorphic relationship field."}, "phone": {"type": "text", "index": 37, "name": "phone", "comment": "The lead\u2019s phone number."}, "postal_code": {"type": "text", "index": 38, "name": "postal_code", "comment": "Postal code for the address of the lead. Label is Zip/Postal Code."}, "state": {"type": "text", "index": 39, "name": "state", "comment": "State for the address of the lead."}, "state_code": {"type": "text", "index": 40, "name": "state_code", "comment": "The ISO state code for the lead\u2019s address."}, "status": {"type": "text", "index": 41, "name": "status", "comment": "Status code for this converted lead. Status codes are defined in Status and represented in the API by the LeadStatus object."}, "street": {"type": "text", "index": 42, "name": "street", "comment": "Street number and name for the address of the lead."}, "title": {"type": "text", "index": 43, "name": "title", "comment": "Title for the lead, such as CFO or CEO."}, "website": {"type": "text", "index": 44, "name": "website", "comment": "Website for the lead."}}, "stats": {"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.stg_salesforce__lead"}, "model.salesforce.stg_salesforce__opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity", "database": "postgres", "comment": "Represents an opportunity, which is a sale or pending deal.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "account_id": {"type": "text", "index": 2, "name": "account_id", "comment": "ID of the account associated with this opportunity."}, "amount": {"type": "numeric(28,6)", "index": 3, "name": "amount", "comment": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products."}, "campaign_id": {"type": "text", "index": 4, "name": "campaign_id", "comment": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled."}, "close_date": {"type": "timestamp without time zone", "index": 5, "name": "close_date", "comment": "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."}, "created_date": {"type": "timestamp without time zone", "index": 6, "name": "created_date", "comment": "Date when the opportunity was created."}, "opportunity_description": {"type": "text", "index": 7, "name": "opportunity_description", "comment": "Text description of the opportunity."}, "expected_revenue": {"type": "numeric(28,6)", "index": 8, "name": "expected_revenue", "comment": "Read-only field that is equal to the product of the opportunity Amount field and the Probability."}, "fiscal": {"type": "text", "index": 9, "name": "fiscal", "comment": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls."}, "fiscal_quarter": {"type": "integer", "index": 10, "name": "fiscal_quarter", "comment": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4."}, "fiscal_year": {"type": "integer", "index": 11, "name": "fiscal_year", "comment": "Represents the fiscal year, for example, 2006."}, "forecast_category": {"type": "text", "index": 12, "name": "forecast_category", "comment": "Restricted picklist field."}, "forecast_category_name": {"type": "text", "index": 13, "name": "forecast_category_name", "comment": "The name of the forecast category."}, "has_open_activity": {"type": "boolean", "index": 14, "name": "has_open_activity", "comment": "Indicates whether an opportunity has an open event or task (true) or not (false)."}, "has_opportunity_line_item": {"type": "boolean", "index": 15, "name": "has_opportunity_line_item", "comment": "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."}, "has_overdue_task": {"type": "boolean", "index": 16, "name": "has_overdue_task", "comment": "Indicates whether an opportunity has an overdue task (true) or not (false)."}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": "The unique, system-generated ID assigned during creation."}, "is_closed": {"type": "boolean", "index": 18, "name": "is_closed", "comment": "True, if Stage Name Label is Closed."}, "is_deleted": {"type": "boolean", "index": 19, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "is_won": {"type": "boolean", "index": 20, "name": "is_won", "comment": "True, if Stage Name Label is Won."}, "last_activity_date": {"type": "timestamp without time zone", "index": 21, "name": "last_activity_date", "comment": "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."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 22, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 23, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 24, "name": "lead_source", "comment": "Source of this opportunity, such as Advertisement or Trade Show."}, "opportunity_name": {"type": "text", "index": 25, "name": "opportunity_name", "comment": "Required. A name for this opportunity."}, "next_step": {"type": "text", "index": 26, "name": "next_step", "comment": "Description of next task in closing opportunity."}, "owner_id": {"type": "text", "index": 27, "name": "owner_id", "comment": "ID of the User who has been assigned to work this opportunity."}, "probability": {"type": "double precision", "index": 28, "name": "probability", "comment": "Percentage of estimated confidence in closing the opportunity."}, "record_type_id": {"type": "text", "index": 29, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "stage_name": {"type": "text", "index": 30, "name": "stage_name", "comment": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity."}, "synced_quote_id": {"type": "text", "index": 31, "name": "synced_quote_id", "comment": "The ID of the Quote that syncs with the opportunity."}, "type": {"type": "text", "index": 32, "name": "type", "comment": "Type of opportunity. For example, Existing Business or New Business."}, "is_created_this_month": {"type": "boolean", "index": 33, "name": "is_created_this_month", "comment": "Yes, if the opportunity created date is in the current month."}, "is_created_this_quarter": {"type": "boolean", "index": 34, "name": "is_created_this_quarter", "comment": "Yes, if the opportunity created date is in the current quarter."}, "days_since_created": {"type": "integer", "index": 35, "name": "days_since_created", "comment": "The difference, in days, between the opportunity created date and the current timestamp."}, "days_to_close": {"type": "integer", "index": 36, "name": "days_to_close", "comment": "The difference, in days, between the opportunity created date and the opportunity close date."}, "is_closed_this_month": {"type": "boolean", "index": 37, "name": "is_closed_this_month", "comment": "Yes, if the opportunity close date is in the current month."}, "is_closed_this_quarter": {"type": "boolean", "index": 38, "name": "is_closed_this_quarter", "comment": "Yes, if the opportunity close date is in the current quarter."}}, "stats": {"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.stg_salesforce__opportunity"}, "model.salesforce.stg_salesforce__opportunity_history": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_history", "database": "postgres", "comment": "Represents historical records of opportunities, which are sales or pending deals.", "owner": "postgres"}, "columns": {"opportunity_id": {"type": "text", "index": 1, "name": "opportunity_id", "comment": "The unique, system-generated ID assigned during creation."}, "_fivetran_start": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_start", "comment": "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."}, "_fivetran_end": {"type": "timestamp without time zone", "index": 3, "name": "_fivetran_end", "comment": "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."}, "_fivetran_date": {"type": "date", "index": 4, "name": "_fivetran_date", "comment": "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."}, "history_unique_key": {"type": "text", "index": 5, "name": "history_unique_key", "comment": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`."}, "_fivetran_active": {"type": "boolean", "index": 6, "name": "_fivetran_active", "comment": "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."}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 7, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "account_id": {"type": "text", "index": 8, "name": "account_id", "comment": "ID of the account associated with this opportunity."}, "amount": {"type": "double precision", "index": 9, "name": "amount", "comment": "Estimated total sale amount. For opportunities with products, the amount is the sum of the related products."}, "campaign_id": {"type": "integer", "index": 10, "name": "campaign_id", "comment": "ID of a related Campaign. This field is defined only for those organizations that have the campaign feature Campaigns enabled."}, "close_date": {"type": "timestamp without time zone", "index": 11, "name": "close_date", "comment": "Required. Date when the opportunity is expected to close."}, "created_date": {"type": "timestamp without time zone", "index": 12, "name": "created_date", "comment": "Date when the opportunity is was created."}, "description": {"type": "integer", "index": 13, "name": "description", "comment": null}, "expected_revenue": {"type": "double precision", "index": 14, "name": "expected_revenue", "comment": "Read-only field that is equal to the product of the opportunity Amount field and the Probability."}, "fiscal": {"type": "text", "index": 15, "name": "fiscal", "comment": "If fiscal years are not enabled, the name of the fiscal quarter or period in which the opportunity CloseDate falls."}, "fiscal_quarter": {"type": "integer", "index": 16, "name": "fiscal_quarter", "comment": "Represents the fiscal quarter. Valid values are 1, 2, 3, or 4."}, "fiscal_year": {"type": "integer", "index": 17, "name": "fiscal_year", "comment": "Represents the fiscal year, for example, 2006."}, "forecast_category": {"type": "text", "index": 18, "name": "forecast_category", "comment": "Restricted picklist field."}, "forecast_category_name": {"type": "text", "index": 19, "name": "forecast_category_name", "comment": "The name of the forecast category."}, "has_open_activity": {"type": "boolean", "index": 20, "name": "has_open_activity", "comment": "Indicates whether an opportunity has an open event or task (true) or not (false)."}, "has_opportunity_line_item": {"type": "boolean", "index": 21, "name": "has_opportunity_line_item", "comment": "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."}, "has_overdue_task": {"type": "boolean", "index": 22, "name": "has_overdue_task", "comment": "Indicates whether an opportunity has an overdue task (true) or not (false)."}, "is_closed": {"type": "boolean", "index": 23, "name": "is_closed", "comment": "True, if Stage Name Label is Closed."}, "is_deleted": {"type": "boolean", "index": 24, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false)."}, "is_won": {"type": "boolean", "index": 25, "name": "is_won", "comment": "True, if Stage Name Label is Won."}, "last_activity_date": {"type": "timestamp without time zone", "index": 26, "name": "last_activity_date", "comment": "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."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 27, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 28, "name": "last_viewed_date", "comment": "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."}, "lead_source": {"type": "text", "index": 29, "name": "lead_source", "comment": "Source of this opportunity, such as Advertisement or Trade Show."}, "name": {"type": "text", "index": 30, "name": "name", "comment": null}, "next_step": {"type": "integer", "index": 31, "name": "next_step", "comment": "Description of next task in closing opportunity."}, "owner_id": {"type": "text", "index": 32, "name": "owner_id", "comment": "ID of the User who has been assigned to work this opportunity."}, "probability": {"type": "integer", "index": 33, "name": "probability", "comment": "Percentage of estimated confidence in closing the opportunity."}, "record_type_id": {"type": "text", "index": 34, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "stage_name": {"type": "text", "index": 35, "name": "stage_name", "comment": "Required. Current stage of this record. The StageName field controls several other fields on an opportunity."}, "synced_quote_id": {"type": "integer", "index": 36, "name": "synced_quote_id", "comment": "The ID of the Quote that syncs with the opportunity."}, "type": {"type": "text", "index": 37, "name": "type", "comment": "Type of opportunity. For example, Existing Business or New Business."}}, "stats": {"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.stg_salesforce__opportunity_history"}, "model.salesforce.stg_salesforce__opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "database": "postgres", "comment": "Represents an opportunity line item, which is a member of the list of Product2 products associated with an Opportunity.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "opportunity_line_item_id": {"type": "text", "index": 2, "name": "opportunity_line_item_id", "comment": "Line Item ID"}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": "Created Date"}, "opportunity_line_item_description": {"type": "text", "index": 5, "name": "opportunity_line_item_description", "comment": "Text description of the opportunity line item."}, "discount": {"type": "double precision", "index": 6, "name": "discount", "comment": "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"}, "has_quantity_schedule": {"type": "boolean", "index": 7, "name": "has_quantity_schedule", "comment": "Read-only. Indicates whether a quantity schedule has been created for this object (true) or not (false)."}, "has_revenue_schedule": {"type": "boolean", "index": 8, "name": "has_revenue_schedule", "comment": "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."}, "has_schedule": {"type": "boolean", "index": 9, "name": "has_schedule", "comment": "If either HasQuantitySchedule or HasRevenueSchedule is true, this field is also true."}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": "Deleted"}, "last_modified_by_id": {"type": "text", "index": 11, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 12, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_referenced_date": {"type": "timestamp without time zone", "index": 13, "name": "last_referenced_date", "comment": "The timestamp for when the current user last viewed a record related to this record. Available in API version 50.0 and later."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 14, "name": "last_viewed_date", "comment": "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."}, "list_price": {"type": "numeric(28,6)", "index": 15, "name": "list_price", "comment": "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."}, "opportunity_line_item_name": {"type": "text", "index": 16, "name": "opportunity_line_item_name", "comment": "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."}, "opportunity_id": {"type": "text", "index": 17, "name": "opportunity_id", "comment": "Required. ID of the associated Opportunity. This is a relationship field."}, "pricebook_entry_id": {"type": "text", "index": 18, "name": "pricebook_entry_id", "comment": "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."}, "product_2_id": {"type": "text", "index": 19, "name": "product_2_id", "comment": "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"}, "product_code": {"type": "text", "index": 20, "name": "product_code", "comment": "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."}, "quantity": {"type": "double precision", "index": 21, "name": "quantity", "comment": "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"}, "service_date": {"type": "timestamp without time zone", "index": 22, "name": "service_date", "comment": "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"}, "sort_order": {"type": "integer", "index": 23, "name": "sort_order", "comment": "Number indicating the sort order selected by the user. Client applications can use this to match the sort order in Salesforce."}, "total_price": {"type": "numeric(28,6)", "index": 24, "name": "total_price", "comment": "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"}, "unit_price": {"type": "numeric(28,6)", "index": 25, "name": "unit_price", "comment": "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"}}, "stats": {"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.stg_salesforce__opportunity_line_item"}, "model.salesforce.stg_salesforce__order": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__order", "database": "postgres", "comment": "Represents an order associated with a contract or an account.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "order_id": {"type": "text", "index": 2, "name": "order_id", "comment": "order id"}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "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."}, "activated_by_id": {"type": "text", "index": 4, "name": "activated_by_id", "comment": "ID of the User who activated this order. This is a relationship field."}, "activated_date": {"type": "timestamp without time zone", "index": 5, "name": "activated_date", "comment": "Date and time when the order was activated."}, "billing_city": {"type": "text", "index": 6, "name": "billing_city", "comment": "City for the billing address for this order. Maximum size is 40 characters."}, "billing_country": {"type": "text", "index": 7, "name": "billing_country", "comment": "Country for the billing address for this order. Maximum size is 80 characters."}, "billing_country_code": {"type": "text", "index": 8, "name": "billing_country_code", "comment": "ISO country code for the billing address for this order."}, "billing_postal_code": {"type": "text", "index": 9, "name": "billing_postal_code", "comment": "Postal code for the billing address for this order. Maximum size is 20 characters."}, "billing_state": {"type": "text", "index": 10, "name": "billing_state", "comment": "State for the billing address for this order. Maximum size is 80 characters."}, "billing_state_code": {"type": "text", "index": 11, "name": "billing_state_code", "comment": "ISO state code for the order\u2019s billing address."}, "billing_street": {"type": "text", "index": 12, "name": "billing_street", "comment": "Street address for the billing address."}, "contract_id": {"type": "text", "index": 13, "name": "contract_id", "comment": "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."}, "created_by_id": {"type": "text", "index": 14, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 15, "name": "created_date", "comment": "Created Date"}, "order_description": {"type": "text", "index": 16, "name": "order_description", "comment": "Description of the order."}, "end_date": {"type": "timestamp without time zone", "index": 17, "name": "end_date", "comment": "Date at which the order ends. Label is Order End Date."}, "is_deleted": {"type": "boolean", "index": 18, "name": "is_deleted", "comment": "deleted"}, "last_modified_by_id": {"type": "text", "index": 19, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 20, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_referenced_date": {"type": "timestamp without time zone", "index": 21, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 22, "name": "last_viewed_date", "comment": "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."}, "opportunity_id": {"type": "text", "index": 23, "name": "opportunity_id", "comment": "ID for the opportunity that\u2019s associated with this order."}, "order_number": {"type": "text", "index": 24, "name": "order_number", "comment": "Order number assigned to this order (not the unique, system-generated ID assigned during creation). Maximum size is 30 characters."}, "original_order_id": {"type": "text", "index": 25, "name": "original_order_id", "comment": "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."}, "owner_id": {"type": "text", "index": 26, "name": "owner_id", "comment": "Required. ID of the User or queue that owns this order. This is a polymorphic relationship field."}, "pricebook_2_id": {"type": "text", "index": 27, "name": "pricebook_2_id", "comment": "Required. ID of the price book associated with this order. This is a relationship field."}, "shipping_city": {"type": "text", "index": 28, "name": "shipping_city", "comment": "City of the shipping address. Maximum size is 40 characters."}, "shipping_country": {"type": "text", "index": 29, "name": "shipping_country", "comment": "Country of the shipping address. Maximum size is 80 characters."}, "shipping_country_code": {"type": "text", "index": 30, "name": "shipping_country_code", "comment": "ISO country code for the order\u2019s shipping address."}, "shipping_postal_code": {"type": "text", "index": 31, "name": "shipping_postal_code", "comment": "Postal code of the shipping address. Maximum size is 20 characters."}, "shipping_state": {"type": "text", "index": 32, "name": "shipping_state", "comment": "State of the shipping address. Maximum size is 80 characters."}, "shipping_state_code": {"type": "text", "index": 33, "name": "shipping_state_code", "comment": "ISO state code for the order\u2019s shipping address."}, "shipping_street": {"type": "text", "index": 34, "name": "shipping_street", "comment": "Street address of the shipping address. Maximum of 255 characters."}, "status": {"type": "text", "index": 35, "name": "status", "comment": "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."}, "total_amount": {"type": "numeric(28,6)", "index": 36, "name": "total_amount", "comment": "The total amount for the order products associated with this order. This field is available in API v48.0 and later."}, "type": {"type": "text", "index": 37, "name": "type", "comment": "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."}}, "stats": {"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.stg_salesforce__order"}, "model.salesforce.stg_salesforce__product_2": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__product_2", "database": "postgres", "comment": "Represents a product that your company sells.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "product_2_id": {"type": "text", "index": 2, "name": "product_2_id", "comment": "The unique, system-generated ID assigned during creation."}, "created_by_id": {"type": "text", "index": 3, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 4, "name": "created_date", "comment": "Created Date"}, "product_2_description": {"type": "text", "index": 5, "name": "product_2_description", "comment": "A text description of this record. Label is Product Description."}, "display_url": {"type": "text", "index": 6, "name": "display_url", "comment": "URL leading to a specific version of a record in the linked external data source."}, "external_id": {"type": "text", "index": 7, "name": "external_id", "comment": "The unique identifier of a record in the linked external data source. For example, ID"}, "family": {"type": "text", "index": 8, "name": "family", "comment": "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."}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": "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."}, "is_archived": {"type": "boolean", "index": 10, "name": "is_archived", "comment": "Describes whether the product is archived. The default value is false."}, "is_deleted": {"type": "boolean", "index": 11, "name": "is_deleted", "comment": "Indicates whether the object has been moved to the Recycle Bin (true) or not (false). Label is Deleted."}, "last_modified_by_id": {"type": "text", "index": 12, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 13, "name": "last_modified_date", "comment": "Last Modified Date"}, "last_referenced_date": {"type": "timestamp without time zone", "index": 14, "name": "last_referenced_date", "comment": "The timestamp when the current user last accessed this record, a record related to this record, or a list view."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 15, "name": "last_viewed_date", "comment": "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."}, "product_2_name": {"type": "text", "index": 16, "name": "product_2_name", "comment": "Required. Default name of this record. Label is Product Name."}, "number_of_quantity_installments": {"type": "integer", "index": 17, "name": "number_of_quantity_installments", "comment": "If the product has a quantity schedule, the number of installments."}, "number_of_revenue_installments": {"type": "integer", "index": 18, "name": "number_of_revenue_installments", "comment": "If the product has a revenue schedule, the number of installments."}, "product_code": {"type": "text", "index": 19, "name": "product_code", "comment": "Default product code for this record. Your org defines the product code naming pattern."}, "quantity_installment_period": {"type": "text", "index": 20, "name": "quantity_installment_period", "comment": "If the product has a quantity schedule, the amount of time covered by the schedule."}, "quantity_schedule_type": {"type": "text", "index": 21, "name": "quantity_schedule_type", "comment": "The type of the quantity schedule, if the product has one."}, "quantity_unit_of_measure": {"type": "text", "index": 22, "name": "quantity_unit_of_measure", "comment": "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."}, "record_type_id": {"type": "text", "index": 23, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "revenue_installment_period": {"type": "text", "index": 24, "name": "revenue_installment_period", "comment": "If the product has a revenue schedule, the time period covered by the schedule."}, "revenue_schedule_type": {"type": "text", "index": 25, "name": "revenue_schedule_type", "comment": "The type of the revenue schedule, if the product has one."}}, "stats": {"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.stg_salesforce__product_2"}, "model.salesforce.stg_salesforce__record_type": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__record_type", "database": "postgres", "comment": "Represents a record type, which lets you offer different business processes, picklist values, and page layouts to different users.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record."}, "record_type_id": {"type": "text", "index": 2, "name": "record_type_id", "comment": "The unique, system-generated ID assigned during creation."}, "record_type_description": {"type": "text", "index": 3, "name": "record_type_description", "comment": "Description of the record type."}, "developer_name": {"type": "text", "index": 4, "name": "developer_name", "comment": "The unique name of the object in the API."}, "is_active": {"type": "boolean", "index": 5, "name": "is_active", "comment": "Indicates whether this record type is available for use."}, "record_type_name": {"type": "text", "index": 6, "name": "record_type_name", "comment": "Label for this record type visible to users."}, "namespace_prefix": {"type": "text", "index": 7, "name": "namespace_prefix", "comment": "The namespace prefix associated with this object."}, "sobject_type": {"type": "text", "index": 8, "name": "sobject_type", "comment": "The Salesforce object that this record type applies to."}}, "stats": {"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.stg_salesforce__record_type"}, "model.salesforce.stg_salesforce__task": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__task", "database": "postgres", "comment": "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.", "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "task_id": {"type": "text", "index": 2, "name": "task_id", "comment": "The unique, system-generated ID assigned during creation."}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "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."}, "activity_date": {"type": "timestamp without time zone", "index": 4, "name": "activity_date", "comment": "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."}, "call_disposition": {"type": "text", "index": 5, "name": "call_disposition", "comment": "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."}, "call_duration_in_seconds": {"type": "integer", "index": 6, "name": "call_duration_in_seconds", "comment": "Duration of the call in seconds. Not subject to field-level security, available for any user in an organization with Salesforce CRM Call Center."}, "call_object": {"type": "text", "index": 7, "name": "call_object", "comment": "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."}, "call_type": {"type": "text", "index": 8, "name": "call_type", "comment": "The type of call being answered: Inbound, Internal, or Outbound."}, "completed_date_time": {"type": "timestamp without time zone", "index": 9, "name": "completed_date_time", "comment": "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."}, "created_by_id": {"type": "text", "index": 10, "name": "created_by_id", "comment": "Created By ID"}, "created_date": {"type": "timestamp without time zone", "index": 11, "name": "created_date", "comment": "Created Date"}, "task_description": {"type": "text", "index": 12, "name": "task_description", "comment": "Contains a text description of the task."}, "is_archived": {"type": "boolean", "index": 13, "name": "is_archived", "comment": "Indicates whether the event has been archived."}, "is_closed": {"type": "boolean", "index": 14, "name": "is_closed", "comment": "Indicates whether the task has been completed (true) or not (false). Is only set indirectly via the Status picklist. Label is Closed."}, "is_deleted": {"type": "boolean", "index": 15, "name": "is_deleted", "comment": "Deleted"}, "is_high_priority": {"type": "boolean", "index": 16, "name": "is_high_priority", "comment": "Indicates a high-priority task. This field is derived from the Priority field."}, "last_modified_by_id": {"type": "text", "index": 17, "name": "last_modified_by_id", "comment": "Last Modified By ID"}, "last_modified_date": {"type": "timestamp without time zone", "index": 18, "name": "last_modified_date", "comment": "Last Modified Date"}, "owner_id": {"type": "text", "index": 19, "name": "owner_id", "comment": "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."}, "priority": {"type": "text", "index": 20, "name": "priority", "comment": "Required. Indicates the importance or urgency of a task, such as high or low."}, "record_type_id": {"type": "text", "index": 21, "name": "record_type_id", "comment": "ID of the record type assigned to this object."}, "status": {"type": "text", "index": 22, "name": "status", "comment": "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."}, "subject": {"type": "text", "index": 23, "name": "subject", "comment": "The subject line of the task, such as \u201cCall\u201d or \u201cSend Quote.\u201d"}, "task_subtype": {"type": "text", "index": 24, "name": "task_subtype", "comment": "Provides standard subtypes to facilitate creating and searching for specific task subtypes."}, "type": {"type": "text", "index": 25, "name": "type", "comment": "The type of task, such as Call or Meeting."}, "what_count": {"type": "integer", "index": 26, "name": "what_count", "comment": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhatId. Count of the WhatId must be 1 or less."}, "what_id": {"type": "text", "index": 27, "name": "what_id", "comment": "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."}, "who_count": {"type": "integer", "index": 28, "name": "who_count", "comment": "Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId."}, "who_id": {"type": "text", "index": 29, "name": "who_id", "comment": "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."}}, "stats": {"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.stg_salesforce__task"}, "model.salesforce.stg_salesforce__user": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__user", "database": "postgres", "comment": "Represents a user in your organization.", "owner": "postgres"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": "True, if this field has been deleted"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "account_id": {"type": "text", "index": 3, "name": "account_id", "comment": "ID of the Account associated with a Customer Portal user. This field is null for Salesforce users."}, "alias": {"type": "text", "index": 4, "name": "alias", "comment": "Required. The user\u2019s alias. For example, jsmith."}, "city": {"type": "text", "index": 5, "name": "city", "comment": "The city associated with the user. Up to 40 characters allowed."}, "company_name": {"type": "text", "index": 6, "name": "company_name", "comment": "The name of the user\u2019s company."}, "contact_id": {"type": "text", "index": 7, "name": "contact_id", "comment": "ID of the Contact associated with this account. The contact must have a value in the AccountId field or an error occurs."}, "country": {"type": "text", "index": 8, "name": "country", "comment": "The country associated with the user."}, "country_code": {"type": "text", "index": 9, "name": "country_code", "comment": "The ISO country code associated with the user."}, "department": {"type": "text", "index": 10, "name": "department", "comment": "The company department associated with the user."}, "email": {"type": "text", "index": 11, "name": "email", "comment": "Required. The user\u2019s email address."}, "first_name": {"type": "text", "index": 12, "name": "first_name", "comment": "The user\u2019s first name."}, "user_id": {"type": "text", "index": 13, "name": "user_id", "comment": "The unique, system-generated ID assigned during creation."}, "individual_id": {"type": "text", "index": 14, "name": "individual_id", "comment": "ID of the data privacy record associated with this user. This field is available if Data Protection and Privacy is enabled."}, "is_active": {"type": "boolean", "index": 15, "name": "is_active", "comment": "Indicates whether the user has access to log in (true) or not (false)."}, "last_login_date": {"type": "timestamp without time zone", "index": 16, "name": "last_login_date", "comment": "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."}, "last_name": {"type": "text", "index": 17, "name": "last_name", "comment": "Required. The user\u2019s last name."}, "last_referenced_date": {"type": "timestamp without time zone", "index": 18, "name": "last_referenced_date", "comment": "The timestamp for when the current user last viewed a record related to this record."}, "last_viewed_date": {"type": "timestamp without time zone", "index": 19, "name": "last_viewed_date", "comment": "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."}, "manager_id": {"type": "text", "index": 20, "name": "manager_id", "comment": "The Id of the user who manages this user."}, "user_name": {"type": "text", "index": 21, "name": "user_name", "comment": "Concatenation of FirstName and LastName."}, "postal_code": {"type": "text", "index": 22, "name": "postal_code", "comment": "The user\u2019s postal or ZIP code."}, "profile_id": {"type": "text", "index": 23, "name": "profile_id", "comment": "Required. ID of the user\u2019s Profile. Use this value to cache metadata based on profile. In earlier releases, this was RoleId."}, "state": {"type": "text", "index": 24, "name": "state", "comment": "The state associated with the User."}, "state_code": {"type": "text", "index": 25, "name": "state_code", "comment": "The ISO state code associated with the user."}, "street": {"type": "text", "index": 26, "name": "street", "comment": "The street address associated with the User."}, "title": {"type": "text", "index": 27, "name": "title", "comment": "The user\u2019s business title, such as \u201cVice President.\u201d"}, "user_role_id": {"type": "text", "index": 28, "name": "user_role_id", "comment": "ID of the user\u2019s UserRole."}, "user_type": {"type": "text", "index": 29, "name": "user_type", "comment": "The category of user license."}, "username": {"type": "text", "index": 30, "name": "username", "comment": "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."}}, "stats": {"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.stg_salesforce__user"}, "model.salesforce.stg_salesforce__user_role": {"metadata": {"type": "BASE TABLE", "schema": "public_salesforce_dev", "name": "stg_salesforce__user_role", "database": "postgres", "comment": "Represents a user role in your organization.", "owner": "postgres"}, "columns": {"_fivetran_deleted": {"type": "boolean", "index": 1, "name": "_fivetran_deleted", "comment": "True, if this field has been deleted"}, "_fivetran_synced": {"type": "timestamp without time zone", "index": 2, "name": "_fivetran_synced", "comment": "The time at which fivetran last synced this record"}, "developer_name": {"type": "text", "index": 3, "name": "developer_name", "comment": "The unique name of the object in the API."}, "user_role_id": {"type": "text", "index": 4, "name": "user_role_id", "comment": "The unique, system-generated ID assigned during creation"}, "user_role_name": {"type": "text", "index": 5, "name": "user_role_name", "comment": "Required. Name of the role. Corresponds to Label on the user interface."}, "opportunity_access_for_account_owner": {"type": "text", "index": 6, "name": "opportunity_access_for_account_owner", "comment": "Required. The opportunity access level for the account owner."}, "parent_role_id": {"type": "text", "index": 7, "name": "parent_role_id", "comment": "The ID of the parent role."}, "rollup_description": {"type": "text", "index": 8, "name": "rollup_description", "comment": "Description of the forecast rollup."}}, "stats": {"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.stg_salesforce__user_role"}}, "sources": {"source.salesforce.salesforce.account": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.account"}, "source.salesforce.salesforce_history.account": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_account_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.account"}, "source.salesforce.salesforce.campaign": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 2, "name": "_fivetran_active", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "type": {"type": "text", "index": 5, "name": "type", "comment": null}, "status": {"type": "text", "index": 6, "name": "status", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 7, "name": "start_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 8, "name": "end_date", "comment": null}, "is_active": {"type": "boolean", "index": 9, "name": "is_active", "comment": null}, "is_deleted": {"type": "boolean", "index": 10, "name": "is_deleted", "comment": null}, "parent_id": {"type": "text", "index": 11, "name": "parent_id", "comment": null}, "budgeted_cost": {"type": "double precision", "index": 12, "name": "budgeted_cost", "comment": null}, "actual_cost": {"type": "double precision", "index": 13, "name": "actual_cost", "comment": null}, "number_of_leads": {"type": "integer", "index": 14, "name": "number_of_leads", "comment": null}, "number_of_converted_leads": {"type": "integer", "index": 15, "name": "number_of_converted_leads", "comment": null}, "number_of_contacts": {"type": "integer", "index": 16, "name": "number_of_contacts", "comment": null}, "number_of_responses": {"type": "integer", "index": 17, "name": "number_of_responses", "comment": null}, "number_of_opportunities": {"type": "integer", "index": 18, "name": "number_of_opportunities", "comment": null}, "number_of_won_opportunities": {"type": "integer", "index": 19, "name": "number_of_won_opportunities", "comment": null}, "amount_all_opportunities": {"type": "double precision", "index": 20, "name": "amount_all_opportunities", "comment": null}, "description": {"type": "text", "index": 21, "name": "description", "comment": null}, "campaign_member_record_type_id": {"type": "text", "index": 22, "name": "campaign_member_record_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.salesforce.salesforce.campaign"}, "source.salesforce.salesforce_history.campaign": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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}, "id": {"type": "text", "index": 5, "name": "id", "comment": null}, "name": {"type": "text", "index": 6, "name": "name", "comment": null}, "type": {"type": "text", "index": 7, "name": "type", "comment": null}, "status": {"type": "text", "index": 8, "name": "status", "comment": null}, "start_date": {"type": "timestamp without time zone", "index": 9, "name": "start_date", "comment": null}, "end_date": {"type": "timestamp without time zone", "index": 10, "name": "end_date", "comment": null}, "is_active": {"type": "boolean", "index": 11, "name": "is_active", "comment": null}, "is_deleted": {"type": "boolean", "index": 12, "name": "is_deleted", "comment": null}, "parent_id": {"type": "integer", "index": 13, "name": "parent_id", "comment": null}, "budgeted_cost": {"type": "double precision", "index": 14, "name": "budgeted_cost", "comment": null}, "actual_cost": {"type": "double precision", "index": 15, "name": "actual_cost", "comment": null}, "number_of_leads": {"type": "integer", "index": 16, "name": "number_of_leads", "comment": null}, "number_of_converted_leads": {"type": "integer", "index": 17, "name": "number_of_converted_leads", "comment": null}, "number_of_contacts": {"type": "integer", "index": 18, "name": "number_of_contacts", "comment": null}, "number_of_responses": {"type": "integer", "index": 19, "name": "number_of_responses", "comment": null}, "number_of_opportunities": {"type": "integer", "index": 20, "name": "number_of_opportunities", "comment": null}, "number_of_won_opportunities": {"type": "integer", "index": 21, "name": "number_of_won_opportunities", "comment": null}, "amount_all_opportunities": {"type": "double precision", "index": 22, "name": "amount_all_opportunities", "comment": null}, "description": {"type": "text", "index": 23, "name": "description", "comment": null}, "campaign_member_record_type_id": {"type": "text", "index": 24, "name": "campaign_member_record_type_id", "comment": null}}, "stats": {"has_stats": {"id": "has_stats", "label": "Has Stats?", "value": false, "include": false, "description": "Indicates whether there are statistics for this table"}}, "unique_id": "source.salesforce.salesforce_history.campaign"}, "source.salesforce.salesforce.campaign_member": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_campaign_member_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_active": {"type": "boolean", "index": 2, "name": "_fivetran_active", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "account_id": {"type": "text", "index": 4, "name": "account_id", "comment": null}, "campaign_id": {"type": "text", "index": 5, "name": "campaign_id", "comment": null}, "contact_id": {"type": "text", "index": 6, "name": "contact_id", "comment": null}, "created_by_id": {"type": "text", "index": 7, "name": "created_by_id", "comment": null}, "created_date": {"type": "timestamp without time zone", "index": 8, "name": "created_date", "comment": null}, "first_responded_date": {"type": "timestamp without time zone", "index": 9, "name": "first_responded_date", "comment": null}, "has_opted_out_of_email": {"type": "boolean", "index": 10, "name": "has_opted_out_of_email", "comment": null}, "has_responded": {"type": "boolean", "index": 11, "name": "has_responded", "comment": null}, "is_deleted": {"type": "boolean", "index": 12, "name": "is_deleted", "comment": null}, "last_modified_by_id": {"type": "text", "index": 13, "name": "last_modified_by_id", "comment": null}, "lead_id": {"type": "text", "index": 14, "name": "lead_id", "comment": null}, "lead_or_contact_id": {"type": "text", "index": 15, "name": "lead_or_contact_id", "comment": null}, "lead_or_contact_owner_id": {"type": "text", "index": 16, "name": "lead_or_contact_owner_id", "comment": null}, "status": {"type": "text", "index": 17, "name": "status", "comment": null}}, "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.salesforce.campaign_member"}, "source.salesforce.salesforce.contact": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_contact_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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": "integer", "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.salesforce.contact"}, "source.salesforce.salesforce_history.contact": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_contact_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.contact"}, "source.salesforce.salesforce.event": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_event_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.event"}, "source.salesforce.salesforce.lead": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_lead_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.lead"}, "source.salesforce.salesforce.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.opportunity"}, "source.salesforce.salesforce_history.opportunity": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_history_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce_history.opportunity"}, "source.salesforce.salesforce.opportunity_line_item": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_opportunity_line_item_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.opportunity_line_item"}, "source.salesforce.salesforce.order": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_order_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.order"}, "source.salesforce.salesforce.product_2": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_product_2_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.product_2"}, "source.salesforce.salesforce.record_type": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_record_type_data", "database": "postgres", "comment": null, "owner": "postgres"}, "columns": {"_fivetran_synced": {"type": "timestamp without time zone", "index": 1, "name": "_fivetran_synced", "comment": null}, "_fivetran_deleted": {"type": "boolean", "index": 2, "name": "_fivetran_deleted", "comment": null}, "id": {"type": "text", "index": 3, "name": "id", "comment": null}, "name": {"type": "text", "index": 4, "name": "name", "comment": null}, "developer_name": {"type": "text", "index": 5, "name": "developer_name", "comment": null}, "sobject_type": {"type": "text", "index": 6, "name": "sobject_type", "comment": null}, "is_active": {"type": "boolean", "index": 7, "name": "is_active", "comment": null}, "description": {"type": "text", "index": 8, "name": "description", "comment": null}, "namespace_prefix": {"type": "integer", "index": 9, "name": "namespace_prefix", "comment": null}}, "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.salesforce.record_type"}, "source.salesforce.salesforce.task": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_task_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.task"}, "source.salesforce.salesforce.user": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_user_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.user"}, "source.salesforce.salesforce.user_role": {"metadata": {"type": "BASE TABLE", "schema": "public", "name": "sf_user_role_data", "database": "postgres", "comment": null, "owner": "postgres"}, "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.salesforce.user_role"}}, "errors": null} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 9be6f0f2..7b264462 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,250 +1,3 @@ - - - - - - - dbt Docs - - - - - - - - - - - - - - - -
- icons - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - +dbt Docs
icons
diff --git a/docs/manifest.json b/docs/manifest.json index 42ff5beb..630cf8e3 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.11.2", "generated_at": "2026-01-15T14:49:51.685287Z", "invocation_id": "d62650ff-4b90-4b2c-8da2-69b967290cf5", "invocation_started_at": "2026-01-15T14:49:41.404414+00:00", "env": {}, "project_name": "salesforce_integration_tests", "project_id": "587a8ff6488a773aca368d80d6016991", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-01-15T14:49:41.404713+00:00"}, "nodes": {"seed.salesforce_integration_tests.sf_user_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.8824558, "relation_name": "\"postgres\".\"public\".\"sf_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.8901904, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_line_item_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_role_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean"}}, "created_at": 1768488583.8935175, "relation_name": "\"postgres\".\"public\".\"sf_user_role_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.8968055, "relation_name": "\"postgres\".\"public\".\"sf_account_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_order_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9004135, "relation_name": "\"postgres\".\"public\".\"sf_order_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_lead_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9038174, "relation_name": "\"postgres\".\"public\".\"sf_lead_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_history_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9071321, "relation_name": "\"postgres\".\"public\".\"sf_contact_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_task_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9104538, "relation_name": "\"postgres\".\"public\".\"sf_task_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9151716, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_product_2_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9185393, "relation_name": "\"postgres\".\"public\".\"sf_product_2_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_event_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9220028, "relation_name": "\"postgres\".\"public\".\"sf_event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_history_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9253824, "relation_name": "\"postgres\".\"public\".\"sf_account_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9288847, "relation_name": "\"postgres\".\"public\".\"sf_contact_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_data": {"database": "postgres", "schema": "public", "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, "batch_size": null, "lookback": 1, "begin": 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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ 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": 1768488583.9322798, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "model.salesforce.salesforce__contact_daily_history": {"database": "postgres", "schema": "public_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": "56c6c04381799f2c36350c08516d569ba5f36eeff8d7c6fd5fce03741b9122a1"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "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": 1768488585.2480183, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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.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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2206\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 generated_number) - 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('2026-01-15'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__contact_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__contact_daily_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, "primary_key": ["contact_day_id"], "time_spine": null}, "model.salesforce.salesforce__account_daily_history": {"database": "postgres", "schema": "public_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": "bfe43e894026eb02db05d7249d45635189f8aaaa31b01b8280616fbc1b4bca3a"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the account had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "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": 1768488585.1599374, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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.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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2206\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 generated_number) - 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('2026-01-15'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__account_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__account_daily_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, "primary_key": ["account_day_id"], "time_spine": null}, "model.salesforce.salesforce__opportunity_daily_history": {"database": "postgres", "schema": "public_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": "3a8f0fe2a5a5eaed1504ea7e17e5906a34537047244a4a22dba243c078999d4b"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "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": 1768488585.2574775, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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.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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2206\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 generated_number) - 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('2026-01-15'as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__opportunity_daily_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, "primary_key": ["opportunity_day_id"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__opportunity_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__opportunity_history.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity_history", "fqn": ["salesforce", "salesforce_history", "staging", "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": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.3514442, "relation_name": "\"postgres\".\"public_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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "opportunity"], ["salesforce_history", "opportunity"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_opportunity_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "model.salesforce.stg_salesforce__account_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__account_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__account_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__account_history.sql", "unique_id": "model.salesforce.stg_salesforce__account_history", "fqn": ["salesforce", "salesforce_history", "staging", "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": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.3463302, "relation_name": "\"postgres\".\"public_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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "account"], ["salesforce_history", "account"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__account_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_account_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "model.salesforce.stg_salesforce__contact_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__contact_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__contact_history.sql", "unique_id": "model.salesforce.stg_salesforce__contact_history", "fqn": ["salesforce", "salesforce_history", "staging", "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": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.3491287, "relation_name": "\"postgres\".\"public_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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "contact"], ["salesforce_history", "contact"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__contact_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_contact_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"database": "postgres", "schema": "public_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": "726beec62717156effa738674bd806fd705900d5870f56001d359e9b21d72d7c"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_line_item_name"]}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_line_item_description"]}, "opportunity_id": {"name": "opportunity_id", "description": "ID of the associated Opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.line_item_index"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_line_items"]}, "created_date": {"name": "created_date", "description": "Created date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.created_date"]}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.last_modified_date"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.service_date"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pricebook_entry_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_id"]}, "product_2_name": {"name": "product_2_name", "description": "Default name of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_name"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_code"]}, "product_2_description": {"name": "product_2_description", "description": "A text description of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_description"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.list_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.quantity"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.unit_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.has_quantity_schedule"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.has_revenue_schedule"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_external_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_family"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_active"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_archived"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_number_of_quantity_installments"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_installment_period"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_schedule_type"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_unit_of_measure"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_number_of_revenue_installments"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_revenue_installment_period"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_revenue_schedule_type"]}}, "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": 1768488585.528532, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}, {"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item", "model.salesforce.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\".\"public_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\".\"public_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, "primary_key": ["opportunity_line_item_id"], "time_spine": null}, "model.salesforce.salesforce__daily_activity": {"database": "postgres", "schema": "public_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": "417cf6b8adf43a5ad39f54692076d07d44b915ead48d2671420109f643bb17c9"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.date_day"]}, "leads_created": {"name": "leads_created", "description": "Number of leads created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.leads_created"]}, "leads_converted": {"name": "leads_converted", "description": "Number of leads converted on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.leads_converted"]}, "tasks_completed": {"name": "tasks_completed", "description": "Number of tasks for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.tasks_completed"]}, "events_completed": {"name": "events_completed", "description": "Number of events for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.events_completed"]}, "opportunities_created": {"name": "opportunities_created", "description": "Number of opportunities created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_created"]}, "opportunities_won": {"name": "opportunities_won", "description": "Number of opportunities won on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_won"]}, "opportunities_lost": {"name": "opportunities_lost", "description": "Number of opportunities lost on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_lost"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_created_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_won_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_lost_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_amount"]}}, "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": 1768488585.5170798, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('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 {% 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.stg_salesforce__task", "model.salesforce.stg_salesforce__event", "model.salesforce.stg_salesforce__lead", "model.salesforce.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\".\"public_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\".\"public_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\".\"public_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\".\"public_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\".\"public_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\".\"public_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, "primary_key": ["date_day"], "time_spine": null}, "model.salesforce.salesforce__opportunity_enhanced": {"database": "postgres", "schema": "public_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": "0c972e876158bd8a6ac0378efb1714ac69c0297ac523afe09cc9cfb918a00924"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_number": {"name": "account_number", "description": "Number of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_amount_this_month": {"name": "closed_amount_this_month", "description": "The opportunity amount, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_amount_this_quarter": {"name": "closed_amount_this_quarter", "description": "The opportunity amount, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_count_this_month": {"name": "closed_count_this_month", "description": "The opportunity count, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_count_this_quarter": {"name": "closed_count_this_quarter", "description": "The opportunity count, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_amount_this_month": {"name": "created_amount_this_month", "description": "The opportunity amount, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_amount_this_quarter": {"name": "created_amount_this_quarter", "description": "The opportunity amount, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_count_this_month": {"name": "created_count_this_month", "description": "The opportunity count, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_count_this_quarter": {"name": "created_count_this_quarter", "description": "The opportunity count, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_account_id": {"name": "opportunity_account_id", "description": "The id of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_city": {"name": "opportunity_manager_city", "description": "The city associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_id": {"name": "opportunity_manager_id", "description": "The Id of the user who manages this owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_name": {"name": "opportunity_manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_state": {"name": "opportunity_manager_state", "description": "The state associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_city": {"name": "opportunity_owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_name": {"name": "opportunity_owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_state": {"name": "opportunity_owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.owner_id"]}, "status": {"name": "status", "description": "Whether the opportunity is won, lost, in the pipeline, or other.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_position": {"name": "opportunity_owner_position", "description": "Name of the position of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "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": 1768488585.5042245, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__opportunity_enhanced\"", "raw_code": "with opportunity as (\n\n select *\n from {{ ref('stg_salesforce__opportunity') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__user_role') }}\n), \n{% endif %}\n\naccount as (\n\n select *\n from {{ ref('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 {% 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.salesforce.custom_persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role", "model.salesforce.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\".\"public_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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\".\"public_salesforce_dev\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["opportunity_id"], "time_spine": null}, "model.salesforce.salesforce__owner_performance": {"database": "postgres", "schema": "public_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": "150500c5f4e22d26a0e8f15ca3e16243798351c02e44e0eaecd5c029d308a560"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.owner_id"]}, "avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_bookings_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_open"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_to_close"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_pipeline_opp_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "manager_id": {"name": "manager_id", "description": "Manager ID associated with opportunities.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_city": {"name": "owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_name": {"name": "owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_state": {"name": "owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "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": 1768488585.4914758, "relation_name": "\"postgres\".\"public_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 {{ ref('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", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.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\".\"public_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["owner_id"], "time_spine": null}, "model.salesforce.salesforce__sales_snapshot": {"database": "postgres", "schema": "public_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, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_bookings_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_open"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_to_close"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_pipeline_opp_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "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": 1768488585.5061338, "relation_name": "\"postgres\".\"public_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", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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, "primary_key": [], "time_spine": null}, "model.salesforce.salesforce__contact_enhanced": {"database": "postgres", "schema": "public_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": "c981358e10dc974676df279c9c1ff6cd2590373b8403cfb933e643c09980783e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_id"]}, "contact_name": {"name": "contact_name", "description": "Name of contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_name"]}, "account_id": {"name": "account_id", "description": "ID of contact's account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_id"]}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.department"]}, "contact_description": {"name": "contact_description", "description": "A description of the contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_description"]}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.email"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.individual_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.last_activity_date"]}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lead_source"]}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_city"]}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_country"]}, "mailing_country_code": {"name": "mailing_country_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_country_code"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_postal_code"]}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_state"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_state_code"]}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_street"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.master_record_id"]}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mobile_phone"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_owner_id"]}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.phone"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.reports_to_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_owner_name"]}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_name"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_number"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_source"]}, "account_annual_revenue": {"name": "account_annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_annual_revenue"]}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_description"]}, "account_industry": {"name": "account_industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_industry"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_number_of_employees"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_owner_id"]}, "account_parent_id": {"name": "account_parent_id", "description": "ID of the account parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_parent_id"]}, "account_rating": {"name": "account_rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_rating"]}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_type"]}}, "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": 1768488585.512444, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__contact_enhanced\"", "raw_code": "with contact as (\n\n select *\n from {{ ref('stg_salesforce__contact') }}\n), \n\naccount as (\n\n select *\n from {{ ref('stg_salesforce__account') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ ref('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 {{ 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__contact", "model.salesforce.stg_salesforce__account", "model.salesforce.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\".\"public_salesforce_dev\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["contact_id"], "time_spine": null}, "model.salesforce.salesforce__manager_performance": {"database": "postgres", "schema": "public_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": "9b95235b1da7f00fac081087c9d3b2a75f5420f29bfbb3f743482773dbcb773e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "manager_city": {"name": "manager_city", "description": "The city location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_name": {"name": "manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_position": {"name": "manager_position", "description": "The position role of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_state": {"name": "manager_state", "description": "The state location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "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": 1768488585.4849856, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__user_role') }}\n),\n{% endif %}\n\nsalesforce_user as (\n\n select *\n from {{ ref('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 {% 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user_role", "model.salesforce.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\".\"public_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\".\"public_salesforce_dev\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["manager_id"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__opportunity.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__opportunity.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__opportunity"], "alias": "stg_salesforce__opportunity", "checksum": {"name": "sha256", "checksum": "c6e74b46174aa1cbb7dc91f34e363863638304eb2cfaed434ffe1214e60d56ca"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.5707827, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"amount\", opportunity_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"campaign_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"close_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"description\", opportunity_dict, alias=\"opportunity_description\") }},\n {{ salesforce.coalesce_rename(\"expected_revenue\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal_quarter\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal_year\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"forecast_category\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"forecast_category_name\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_open_activity\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_opportunity_line_item\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_overdue_task\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"id\", opportunity_dict, alias=\"opportunity_id\") }},\n {{ salesforce.coalesce_rename(\"is_closed\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"is_won\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"name\", opportunity_dict, alias=\"opportunity_name\") }},\n {{ salesforce.coalesce_rename(\"next_step\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"probability\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"stage_name\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"synced_quote_id\", opportunity_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "opportunity"], ["salesforce", "opportunity"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_opportunity_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.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.salesforce.opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["opportunity_id"], "time_spine": null}, "model.salesforce.stg_salesforce__order": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__order", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__order.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__order.sql", "unique_id": "model.salesforce.stg_salesforce__order", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__order"], "alias": "stg_salesforce__order", "checksum": {"name": "sha256", "checksum": "e4fe18c208b953d2f6e96f9e073c7ce222339b68db76c34e232d68ebf8a9836e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "order_description": {"name": "order_description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.6208746, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", order_dict, alias=\"order_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"activated_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"activated_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_city\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_postal_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_street\", order_dict) }},\n {{ salesforce.coalesce_rename(\"contract_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"description\", order_dict, alias=\"order_description\") }},\n {{ salesforce.coalesce_rename(\"end_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"opportunity_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"order_number\", order_dict) }},\n {{ salesforce.coalesce_rename(\"original_order_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"pricebook_2_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_city\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_postal_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_street\", order_dict) }},\n {{ salesforce.coalesce_rename(\"status\", order_dict) }},\n {{ salesforce.coalesce_rename(\"total_amount\", order_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "order"], ["salesforce", "order"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_order_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["order_id"], "time_spine": null}, "model.salesforce.stg_salesforce__user": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__user", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__user.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__user.sql", "unique_id": "model.salesforce.stg_salesforce__user", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__user"], "alias": "stg_salesforce__user", "checksum": {"name": "sha256", "checksum": "8448fe8529c88533e85f058f8e9d6c3d52275700a8aeef7e0911069190e6fa00"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_name": {"name": "user_name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.58958, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"alias\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"city\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"company_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"contact_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"country\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"country_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"department\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"email\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"first_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"id\", user_dict, alias=\"user_id\" ) }},\n {{ salesforce.coalesce_rename(\"individual_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"is_active\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_login_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"manager_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"name\", user_dict, alias=\"user_name\" ) }},\n {{ salesforce.coalesce_rename(\"postal_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"profile_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"state\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"state_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"street\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"title\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"user_role_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"user_type\", user_dict ) }},\n {{ salesforce.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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "user"], ["salesforce", "user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_user_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["user_id"], "time_spine": null}, "model.salesforce.stg_salesforce__task": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__task", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__task.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__task.sql", "unique_id": "model.salesforce.stg_salesforce__task", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__task"], "alias": "stg_salesforce__task", "checksum": {"name": "sha256", "checksum": "64149d896796d839536af849f48d1c4384413ba689aba140534104e6f73de37e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "task_description": {"name": "task_description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.6316164, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", task_dict, alias=\"task_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_disposition\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_duration_in_seconds\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_object\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_type\", task_dict) }},\n {{ salesforce.coalesce_rename(\"completed_date_time\", task_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"description\", task_dict, alias=\"task_description\") }},\n {{ salesforce.coalesce_rename(\"is_archived\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_closed\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_high_priority\", task_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"priority\", task_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"status\", task_dict) }},\n {{ salesforce.coalesce_rename(\"subject\", task_dict) }},\n {{ salesforce.coalesce_rename(\"task_subtype\", task_dict) }},\n {{ salesforce.coalesce_rename(\"type\", task_dict) }},\n {{ salesforce.coalesce_rename(\"what_count\", task_dict) }},\n {{ salesforce.coalesce_rename(\"what_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"who_count\", task_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "task"], ["salesforce", "task"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_task_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["task_id"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity_line_item": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__opportunity_line_item.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__opportunity_line_item.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity_line_item", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__opportunity_line_item"], "alias": "stg_salesforce__opportunity_line_item", "checksum": {"name": "sha256", "checksum": "0d0c63bb3f3eba994cef70b9d069fc7a0a8e27b9a34650395f4a16ac0248e585"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.615614, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", opportunity_line_item_dict, alias=\"opportunity_line_item_id\") }},\n {{ salesforce.coalesce_rename(\"created_by_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"description\", opportunity_line_item_dict, alias=\"opportunity_line_item_description\") }},\n {{ salesforce.coalesce_rename(\"discount\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_quantity_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_revenue_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"list_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"name\", opportunity_line_item_dict, alias=\"opportunity_line_item_name\") }},\n {{ salesforce.coalesce_rename(\"opportunity_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"pricebook_entry_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"product_2_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"product_code\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"quantity\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"service_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"sort_order\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"total_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "opportunity_line_item"], ["salesforce", "opportunity_line_item"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_opportunity_line_item_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["opportunity_line_item_id"], "time_spine": null}, "model.salesforce.stg_salesforce__user_role": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__user_role", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__user_role.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__user_role.sql", "unique_id": "model.salesforce.stg_salesforce__user_role", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__user_role"], "alias": "stg_salesforce__user_role", "checksum": {"name": "sha256", "checksum": "150992d1cc9b40b7ddf27f58e103906b245c333d84b9b004ea347e0ccadd65b0"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.5938752, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"developer_name\", user_role_dict ) }},\n {{ salesforce.coalesce_rename(\"id\", user_role_dict, alias=\"user_role_id\") }},\n {{ salesforce.coalesce_rename(\"name\", user_role_dict, alias=\"user_role_name\") }},\n {{ salesforce.coalesce_rename(\"opportunity_access_for_account_owner\", user_role_dict ) }},\n {{ salesforce.coalesce_rename(\"parent_role_id\", user_role_dict ) }},\n {{ salesforce.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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "user_role"], ["salesforce", "user_role"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_user_role_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["user_role_id"], "time_spine": null}, "model.salesforce.stg_salesforce__event": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__event", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__event.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__event.sql", "unique_id": "model.salesforce.stg_salesforce__event", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__event"], "alias": "stg_salesforce__event", "checksum": {"name": "sha256", "checksum": "52571ab849bf3ab43cc864b4d3ad1e6d83869770657712b88baa89be4d763b62"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "event_description": {"name": "event_description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.6048262, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", event_dict, alias=\"event_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"description\", event_dict, alias=\"event_description\") }},\n {{ salesforce.coalesce_rename(\"end_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"end_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"event_subtype\", event_dict) }},\n {{ salesforce.coalesce_rename(\"group_event_type\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_archived\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_child\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_group_event\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_recurrence\", event_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"location\", event_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"start_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"subject\", event_dict) }},\n {{ salesforce.coalesce_rename(\"type\", event_dict) }},\n {{ salesforce.coalesce_rename(\"what_count\", event_dict) }},\n {{ salesforce.coalesce_rename(\"what_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"who_count\", event_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "event"], ["salesforce", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_event_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["event_id"], "time_spine": null}, "model.salesforce.stg_salesforce__product_2": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__product_2", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__product_2.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__product_2.sql", "unique_id": "model.salesforce.stg_salesforce__product_2", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__product_2"], "alias": "stg_salesforce__product_2", "checksum": {"name": "sha256", "checksum": "14555f471e20bb0d9dbde8776a0083f91b52069368ac42c03989c95568b50084"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.6265411, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", product_2_dict, alias=\"product_2_id\") }},\n {{ salesforce.coalesce_rename(\"created_by_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"description\", product_2_dict, alias=\"product_2_description\") }},\n {{ salesforce.coalesce_rename(\"display_url\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"external_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"family\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_active\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_archived\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"name\", product_2_dict, alias=\"product_2_name\") }},\n {{ salesforce.coalesce_rename(\"number_of_quantity_installments\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_revenue_installments\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"product_code\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_installment_period\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_schedule_type\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_unit_of_measure\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"revenue_installment_period\", product_2_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "product_2"], ["salesforce", "product_2"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_product_2_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["product_2_id"], "time_spine": null}, "model.salesforce.stg_salesforce__contact": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__contact.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__contact.sql", "unique_id": "model.salesforce.stg_salesforce__contact", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__contact"], "alias": "stg_salesforce__contact", "checksum": {"name": "sha256", "checksum": "21841381164da22dc571072c885ff93baa22e833cf12569a48e02ce62504d211"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.5962937, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", contact_dict, alias=\"contact_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"department\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"description\", contact_dict, alias=\"contact_description\") }},\n {{ salesforce.coalesce_rename(\"email\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"first_name\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"home_phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"individual_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_name\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_city\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_country\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_country_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_postal_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_state\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_state_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_street\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mobile_phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"name\", contact_dict, alias=\"contact_name\") }},\n {{ salesforce.coalesce_rename(\"owner_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"reports_to_id\", contact_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "contact"], ["salesforce", "contact"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_contact_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["contact_id"], "time_spine": null}, "model.salesforce.stg_salesforce__lead": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__lead", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__lead.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__lead.sql", "unique_id": "model.salesforce.stg_salesforce__lead", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__lead"], "alias": "stg_salesforce__lead", "checksum": {"name": "sha256", "checksum": "1ce4e0480404d2a3b7784804d5b99d3d04f0fadc7a4d6e9cf4ba5ac935391a48"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_description": {"name": "lead_description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.6127818, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", lead_dict, alias=\"lead_id\") }},\n {{ salesforce.coalesce_rename(\"annual_revenue\", lead_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"city\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"company\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_account_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_contact_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_opportunity_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"country\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"country_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"description\", lead_dict, alias=\"lead_description\") }},\n {{ salesforce.coalesce_rename(\"email\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"email_bounced_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"email_bounced_reason\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"first_name\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"has_opted_out_of_email\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"individual_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"industry\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_converted\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_unread_by_owner\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_name\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"mobile_phone\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"name\", lead_dict, alias=\"lead_name\") }},\n {{ salesforce.coalesce_rename(\"number_of_employees\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"phone\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"postal_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"state\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"state_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"status\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"street\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"title\", lead_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "lead"], ["salesforce", "lead"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_lead_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["lead_id"], "time_spine": null}, "model.salesforce.stg_salesforce__account": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__account", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__account.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__account.sql", "unique_id": "model.salesforce.stg_salesforce__account", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__account"], "alias": "stg_salesforce__account", "checksum": {"name": "sha256", "checksum": "393969eb0d34ff6508eb1002cebc19f23400a833e15b07c85e703ac1271a96d0"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1768488585.5670092, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_number\", account_dict) }},\n {{ salesforce.coalesce_rename(\"account_source\", account_dict) }},\n {{ salesforce.coalesce_rename(\"annual_revenue\", account_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"billing_city\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_postal_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_street\", account_dict) }},\n {{ salesforce.coalesce_rename(\"description\", account_dict, alias=\"account_description\" ) }},\n {{ salesforce.coalesce_rename(\"id\", account_dict, alias=\"account_id\") }},\n {{ salesforce.coalesce_rename(\"industry\", account_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"name\", account_dict, alias=\"account_name\" ) }},\n {{ salesforce.coalesce_rename(\"number_of_employees\", account_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"ownership\", account_dict) }},\n {{ salesforce.coalesce_rename(\"parent_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"rating\", account_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_city\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_postal_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_street\", account_dict) }},\n {{ salesforce.coalesce_rename(\"type\", account_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "account"], ["salesforce", "account"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_account_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public\".\"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, "primary_key": ["account_id"], "time_spine": null}, "model.salesforce.int_salesforce__date_spine": {"database": "postgres", "schema": "public_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": "9ad85ca49c9b477a4ef0b96713a25d452c176bac73d4d6124c27447f3f85f675"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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": 1768488585.0227404, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"int_salesforce__date_spine\"", "raw_code": "{% if var('salesforce__lead_enabled', True) -%}\n-- depends_on: {{ ref('stg_salesforce__lead') }}\n{% else -%}\n-- depends_on: {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__lead') }}\n {% else %}\n from {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__lead') }}\n {% else %}\n from {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__date_spine.sql", "compiled": true, "compiled_code": "-- depends_on: \"postgres\".\"public_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 <= 32\n order by generated_number\n\n\n\n),\n\nall_periods as (\n\n select (\n \n\n cast('2025-12-15' as date) + ((interval '1 day') * (row_number() over (order by generated_number) - 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('2026-01-15' 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, "primary_key": [], "time_spine": null}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"database": "postgres", "schema": "public_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": "7885ddda21df6369525863d32bf5663cd3d248779c42d338a37ecd7be042c232"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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": 1768488585.0447605, "relation_name": "\"postgres\".\"public_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 {{ ref('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", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.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\".\"public_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"public_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, "primary_key": [], "time_spine": null}, "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": {"database": "postgres", "schema": "public_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": 1768488585.3291628, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.3319898, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.3344104, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.336841, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.3392398, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.3418062, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.3524866, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__account_history_history_unique_key.c378da769f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.3549917, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.3574157, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.3598378, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.3624218, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "fqn": ["salesforce", "salesforce_history", "staging", "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": 1768488585.364854, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_salesforce__manager_performance_manager_id.4adc491650": {"database": "postgres", "schema": "public_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": 1768488585.5297842, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.532361, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5347824, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5372798, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5396984, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5421226, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5445237, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5469253, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5494337, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.551833, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.5542572, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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": 1768488585.556679, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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.not_null_stg_salesforce__account_account_id.1e0ff361d4": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6328325, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__account_account_id.6d58a39ba7": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6354327, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__account", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6378813, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6403918, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__opportunity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.642832, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__user_user_id.9a29b41152": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6452332, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__user", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.647636, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__user_role_user_role_id.1259050718": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6507049, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__contact_contact_id.d7c02bef78": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.65312, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__contact_contact_id.0cc2c0609e": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6554735, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__contact", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.658324, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__event_event_id.13f7c8c0d9": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.660759, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__event", "test_metadata": {"name": "unique", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.663255, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__lead_lead_id.ba8b21e282": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6656587, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__lead", "test_metadata": {"name": "unique", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6680934, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.670483, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__order_order_id.4782f3b34f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6729913, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__order_order_id.12a96b4e3c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6753778, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__order", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6777875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6801603, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__task_task_id.aabe11a5d9": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6825275, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__task_task_id.73684ed605": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605", "fqn": ["salesforce", "salesforce", "staging", "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": 1768488585.6850173, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.salesforce_history.account": {"database": "postgres", "schema": "public", "name": "account", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.account", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_account_history_data\"", "created_at": 1768488585.7624671, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.contact": {"database": "postgres", "schema": "public", "name": "contact", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.contact", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_contact_history_data\"", "created_at": 1768488585.7648737, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.opportunity": {"database": "postgres", "schema": "public", "name": "opportunity", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.opportunity", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_history_data\"", "created_at": 1768488585.765692, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce.account": {"database": "postgres", "schema": "public", "name": "account", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.account", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_account_data\"", "created_at": 1768488585.7665737, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.opportunity": {"database": "postgres", "schema": "public", "name": "opportunity", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.opportunity", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_data\"", "created_at": 1768488585.7673583, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.user": {"database": "postgres", "schema": "public", "name": "user", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.user", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_user_data\"", "created_at": 1768488585.7681446, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.user_role": {"database": "postgres", "schema": "public", "name": "user_role", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.user_role", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_user_role_data\"", "created_at": 1768488585.7686453, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.contact": {"database": "postgres", "schema": "public", "name": "contact", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.contact", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "assistant_name": {"name": "assistant_name", "description": "The assistant\u2019s name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "assistant_phone": {"name": "assistant_phone", "description": "The assistant\u2019s telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "birthdate": {"name": "birthdate", "description": "The contact\u2019s birthdate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The contact\u2019s fax number. Label is Business Fax.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw": {"name": "jigsaw", "description": "Data.com Key", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw contact OD", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_curequest_date": {"name": "last_curequest_date", "description": "Last Stay-in-Touch Request Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_cuupdate_date": {"name": "last_cuupdate_date", "description": "Last Stay-in-Touch Save Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_city": {"name": "other_city", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_country": {"name": "other_country", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_phone": {"name": "other_phone", "description": "Telephone for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_postal_code": {"name": "other_postal_code", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_state": {"name": "other_state", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_street": {"name": "other_street", "description": "Street for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_contact_data\"", "created_at": 1768488585.769373, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.event", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "Indicates the interval between Salesforce Classic recurring events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_event_data\"", "created_at": 1768488585.7700589, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.lead": {"database": "postgres", "schema": "public", "name": "lead", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.lead", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "Accuracy level of the geocode for the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_lead_data\"", "created_at": 1768488585.7707262, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.opportunity_line_item": {"database": "postgres", "schema": "public", "name": "opportunity_line_item", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.opportunity_line_item", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_line_item_data\"", "created_at": 1768488585.7712433, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.order": {"database": "postgres", "schema": "public", "name": "order", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.order", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_order_data\"", "created_at": 1768488585.7724512, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.product_2": {"database": "postgres", "schema": "public", "name": "product_2", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.product_2", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_product_2_data\"", "created_at": 1768488585.7729926, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.task": {"database": "postgres", "schema": "public", "name": "task", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.task", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "The interval between recurring tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_task_data\"", "created_at": 1768488585.7736018, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.fivetran_formula": {"database": "postgres", "schema": "public", "name": "fivetran_formula", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.fivetran_formula", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"fivetran_formula\"", "created_at": 1768488585.7741683, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.fivetran_formula_model": {"database": "postgres", "schema": "public", "name": "fivetran_formula_model", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.fivetran_formula_model", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": []}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"fivetran_formula_model\"", "created_at": 1768488585.7747622, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}}, "macros": {"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": 1768488582.1573792, "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": 1768488582.1581478, "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": 1768488582.1626601, "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": 1768488582.1636815, "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": 1768488582.1643066, "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": 1768488582.1649373, "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": 1768488582.1658745, "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": 1768488582.166755, "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": 1768488582.1671076, "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": 1768488582.1678276, "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": 1768488582.168597, "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": 1768488582.1702416, "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": 1768488582.170638, "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": 1768488582.1712565, "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": 1768488582.1718092, "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": 1768488582.1726594, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.1734176, "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": 1768488582.1745985, "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": 1768488582.1750064, "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": 1768488582.175253, "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": 1768488582.1756032, "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": 1768488582.1758964, "supported_languages": null}, "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": 1768488582.1763313, "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": 1768488582.1767132, "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": 1768488582.1769395, "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": 1768488582.1773477, "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": 1768488582.1775646, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.178504, "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": 1768488582.1787782, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.1809788, "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": 1768488582.1818657, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.1825078, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.1838965, "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": 1768488582.1848445, "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": 1768488582.18564, "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": 1768488582.1897144, "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": 1768488582.19016, "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": 1768488582.191182, "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": 1768488582.1914792, "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": 1768488582.1923275, "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": 1768488582.1926942, "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": 1768488582.1932645, "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": 1768488582.1943393, "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": 1768488582.1954052, "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": 1768488582.1960156, "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": 1768488582.1963098, "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": 1768488582.1965995, "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": 1768488582.197634, "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": 1768488582.1979916, "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": 1768488582.1982687, "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": 1768488582.1994927, "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": 1768488582.1998622, "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": 1768488582.2001388, "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": 1768488582.201493, "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": 1768488582.2019355, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2038856, "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": 1768488582.2047174, "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": 1768488582.2058723, "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": 1768488582.2067914, "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": 1768488582.206948, "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": 1768488582.2086344, "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": 1768488582.2090263, "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": 1768488582.2093172, "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": 1768488582.2096157, "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": 1768488582.2099023, "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": 1768488582.2104642, "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": 1768488582.211066, "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": 1768488582.2116687, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2159219, "supported_languages": ["sql"]}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.219986, "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": 1768488582.223, "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": 1768488582.2237878, "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": 1768488582.2242782, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2268598, "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": 1768488582.2273147, "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": 1768488582.2286112, "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": 1768488582.2297387, "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": 1768488582.2318, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n\t {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n\t {% set unique_key_match = equals(source_unique_key, target_unique_key) | trim %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.235404, "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": 1768488582.2359462, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2373986, "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": 1768488582.237947, "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": 1768488582.2392397, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2408829, "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": 1768488582.2419832, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2424114, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2437782, "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": 1768488582.2442489, "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": 1768488582.2456903, "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": 1768488582.2469351, "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": 1768488582.2474043, "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": 1768488582.247801, "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": 1768488582.2483735, "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": 1768488582.2487576, "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": 1768488582.2493358, "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": 1768488582.2497356, "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": 1768488582.250256, "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": 1768488582.2506328, "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": 1768488582.2509365, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.251437, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.251783, "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": 1768488582.2523403, "supported_languages": null}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2547693, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2551882, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2575736, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2580538, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.260393, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.260886, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2626314, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2710624, "supported_languages": ["sql"]}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2717004, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2720423, "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.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2769377, "supported_languages": ["sql"]}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2774303, "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": 1768488582.277706, "supported_languages": null}, "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": 1768488582.279463, "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": 1768488582.2812471, "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": 1768488582.2817287, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.2827191, "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": 1768488582.28311, "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": 1768488582.2833898, "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": 1768488582.2837012, "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": 1768488582.2839396, "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": 1768488582.284255, "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": 1768488582.2844944, "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": 1768488582.2854457, "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": 1768488582.2859716, "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": 1768488582.2883859, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = 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": 1768488582.29333, "supported_languages": ["sql"]}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3012753, "supported_languages": ["sql"]}, "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": 1768488582.30527, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3059382, "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": 1768488582.3062747, "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": 1768488582.3064618, "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": 1768488582.3067722, "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": 1768488582.3070116, "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": 1768488582.3074224, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3079567, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_sql_cols = get_column_schema_from_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {#/*\n If a column has been added to the source it won't yet exist in the\n snapshotted table so we insert a null value as a placeholder for the column.\n */#}\n {%- for col in source_sql_cols -%}\n {%- if col.name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col.column) }},\n {%- else -%}\n NULL as {{ adapter.quote(col.column) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.316808, "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": 1768488582.3172467, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.318281, "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": 1768488582.3191402, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3203254, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.321189, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3217707, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3224542, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3236136, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3240426, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3244624, "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": 1768488582.3285053, "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": 1768488582.3288774, "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": 1768488582.329334, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3312943, "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": 1768488582.3316476, "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": 1768488582.331994, "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": 1768488582.3349626, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3378444, "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": 1768488582.3386996, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.34034, "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 {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ 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": 1768488582.3440783, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3485625, "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": 1768488582.3496263, "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": 1768488582.3502562, "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": 1768488582.3506925, "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": 1768488582.3519197, "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": 1768488582.3525317, "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": 1768488582.353299, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.35512, "supported_languages": ["sql", "python"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3558388, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.356882, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.358216, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.358538, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3589242, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.359789, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.360123, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3607738, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.361105, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.36132, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.361667, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3624902, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.362875, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3633995, "supported_languages": null}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3645492, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.365283, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3656294, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.365866, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3661907, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3668573, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.367202, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.367417, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3677635, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3681421, "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": 1768488582.3686402, "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": 1768488582.3688939, "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": 1768488582.369454, "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": 1768488582.369631, "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": 1768488582.3702242, "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": 1768488582.3707576, "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": 1768488582.3710546, "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": 1768488582.3716564, "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": 1768488582.3719969, "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": 1768488582.3724694, "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": 1768488582.372705, "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": 1768488582.3731868, "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": 1768488582.3735096, "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": 1768488582.3740683, "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": 1768488582.3743384, "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": 1768488582.3752673, "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": 1768488582.376433, "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": 1768488582.376896, "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": 1768488582.377612, "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": 1768488582.3781383, "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": 1768488582.3784091, "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": 1768488582.3792636, "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": 1768488582.379765, "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": 1768488582.3802805, "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": 1768488582.3805592, "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": 1768488582.381871, "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": 1768488582.3821752, "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": 1768488582.382499, "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": 1768488582.3828368, "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": 1768488582.3831599, "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": 1768488582.3835075, "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": 1768488582.3838527, "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": 1768488582.3842072, "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": 1768488582.3845255, "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": 1768488582.3848414, "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": 1768488582.3851597, "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": 1768488582.385448, "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": 1768488582.3857825, "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": 1768488582.3860703, "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": 1768488582.3867028, "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": 1768488582.3873932, "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": 1768488582.3879552, "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": 1768488582.3882332, "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": 1768488582.3887753, "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": 1768488582.3890414, "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": 1768488582.3897514, "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": 1768488582.390091, "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": 1768488582.3905435, "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": 1768488582.3911, "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": 1768488582.391377, "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": 1768488582.391982, "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": 1768488582.392315, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.3929465, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.393541, "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": 1768488582.3940275, "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": 1768488582.3943436, "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": 1768488582.3949215, "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": 1768488582.3952081, "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": 1768488582.395819, "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": 1768488582.3962653, "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": 1768488582.396816, "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": 1768488582.3970907, "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": 1768488582.3975286, "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": 1768488582.3977165, "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": 1768488582.398188, "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": 1768488582.3984013, "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": 1768488582.399259, "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": 1768488582.4000783, "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": 1768488582.4005568, "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": 1768488582.4007864, "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": 1768488582.4016135, "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": 1768488582.4024239, "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": 1768488582.4028094, "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": 1768488582.403879, "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": 1768488582.4043689, "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": 1768488582.4045947, "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": 1768488582.405303, "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": 1768488582.4063015, "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": 1768488582.4069076, "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": 1768488582.407439, "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": 1768488582.4084623, "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": 1768488582.410834, "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": 1768488582.4117424, "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": 1768488582.412613, "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": 1768488582.413034, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4136477, "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": 1768488582.4143047, "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": 1768488582.4148326, "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": 1768488582.4153337, "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": 1768488582.4157825, "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": 1768488582.4166281, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4173994, "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": 1768488582.41777, "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": 1768488582.4181685, "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": 1768488582.418681, "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": 1768488582.4192653, "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": 1768488582.4196842, "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": 1768488582.4202635, "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": 1768488582.4206922, "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": 1768488582.421202, "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": 1768488582.42149, "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": 1768488582.4220126, "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": 1768488582.4223032, "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": 1768488582.422816, "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": 1768488582.4231057, "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": 1768488582.424112, "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": 1768488582.4244814, "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": 1768488582.4250355, "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": 1768488582.4253218, "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": 1768488582.4258025, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4260542, "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": 1768488582.4266288, "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": 1768488582.4268987, "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": 1768488582.428389, "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": 1768488582.4286501, "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": 1768488582.429714, "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": 1768488582.4300423, "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": 1768488582.4303231, "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": 1768488582.432841, "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": 1768488582.4335966, "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": 1768488582.4342597, "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": 1768488582.4349737, "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": 1768488582.4352932, "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": 1768488582.4356637, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4365225, "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": 1768488582.4374814, "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": 1768488582.4377902, "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": 1768488582.4400644, "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": 1768488582.4404542, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4409332, "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": 1768488582.4414394, "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": 1768488582.4417481, "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": 1768488582.4422054, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4424474, "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": 1768488582.4437199, "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": 1768488582.444094, "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": 1768488582.4449544, "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": 1768488582.4463825, "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": 1768488582.4473085, "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": 1768488582.4476914, "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": 1768488582.448053, "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": 1768488582.448558, "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": 1768488582.4488826, "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": 1768488582.4493856, "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": 1768488582.4496963, "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": 1768488582.4501562, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4504046, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4555013, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4566677, "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 -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4588609, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4592805, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4594755, "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": 1768488582.4605024, "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": 1768488582.4611108, "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": 1768488582.4615734, "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": 1768488582.4621515, "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": 1768488582.4628694, "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": 1768488582.463628, "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": 1768488582.4642992, "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": 1768488582.4648182, "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": 1768488582.4656365, "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": 1768488582.466157, "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": 1768488582.4667325, "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": 1768488582.4692028, "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": 1768488582.4704626, "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": 1768488582.471055, "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": 1768488582.472456, "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": 1768488582.474776, "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": 1768488582.4762232, "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": 1768488582.4766924, "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": 1768488582.4779706, "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": 1768488582.4782956, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4790554, "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": 1768488582.4796286, "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": 1768488582.4801006, "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": 1768488582.4807317, "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": 1768488582.4810827, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.481433, "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": 1768488582.4819307, "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": 1768488582.4829972, "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": 1768488582.4834347, "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": 1768488582.4837308, "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": 1768488582.4852688, "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": 1768488582.4859247, "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": 1768488582.4863205, "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": 1768488582.4868438, "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": 1768488582.4872024, "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": 1768488582.487515, "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": 1768488582.4878864, "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": 1768488582.4883642, "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": 1768488582.4887805, "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": 1768488582.4893615, "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": 1768488582.489737, "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": 1768488582.490052, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4904053, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4907315, "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": 1768488582.491061, "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": 1768488582.491357, "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": 1768488582.4917727, "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": 1768488582.4921072, "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": 1768488582.492991, "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": 1768488582.493286, "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": 1768488582.493576, "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": 1768488582.4938414, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.495104, "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": 1768488582.4954357, "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": 1768488582.4956064, "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": 1768488582.4959319, "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": 1768488582.496251, "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": 1768488582.4968624, "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": 1768488582.497223, "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": 1768488582.4975348, "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": 1768488582.497909, "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": 1768488582.4987607, "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": 1768488582.4995537, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.4999747, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5005984, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5013297, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.501713, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.502091, "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": 1768488582.5026314, "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": 1768488582.503076, "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": 1768488582.5039935, "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": 1768488582.5042763, "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": 1768488582.55478, "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": 1768488582.5557225, "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": 1768488582.556119, "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": 1768488582.5564096, "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": 1768488582.556748, "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": 1768488582.5570083, "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": 1768488582.5590549, "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": 1768488582.559296, "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": 1768488582.5596428, "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": 1768488582.5598798, "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": 1768488582.5605516, "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": 1768488582.5609474, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5611932, "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": 1768488582.5616488, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5620606, "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": 1768488582.5624986, "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.render() }} 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": 1768488582.563034, "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": 1768488582.563493, "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": 1768488582.5648377, "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": 1768488582.565216, "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": 1768488582.5657344, "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": 1768488582.5661824, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5684311, "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": 1768488582.5706074, "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": 1768488582.570929, "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": 1768488582.571527, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5721102, "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": 1768488582.572534, "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": 1768488582.572951, "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": 1768488582.573303, "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": 1768488582.5757077, "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": 1768488582.5763981, "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": 1768488582.5767748, "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": 1768488582.5774403, "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": 1768488582.5778973, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.579168, "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": 1768488582.5796807, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.5812297, "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": 1768488582.5820718, "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": 1768488582.5824046, "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": 1768488582.5828178, "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": 1768488582.5831475, "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": 1768488582.5836947, "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": 1768488582.584617, "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": 1768488582.5854437, "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": 1768488582.585947, "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": 1768488582.5865362, "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": 1768488582.5871177, "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": 1768488582.590739, "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": 1768488582.5920985, "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": 1768488582.5938241, "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": 1768488582.5952334, "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": 1768488582.596659, "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": 1768488582.5984645, "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": 1768488582.5988579, "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": 1768488582.599817, "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": 1768488582.6000478, "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": 1768488582.607038, "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": 1768488582.6073282, "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": 1768488582.6074882, "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": 1768488582.6111686, "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": 1768488582.6134448, "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": 1768488582.6141093, "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": 1768488582.614645, "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": 1768488582.6151702, "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": 1768488582.615748, "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": 1768488582.616149, "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": 1768488582.616552, "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": 1768488582.6173384, "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": 1768488582.6181068, "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": 1768488582.6188316, "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": 1768488582.6195307, "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": 1768488582.6205258, "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": 1768488582.6222904, "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": 1768488582.6232035, "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": 1768488582.6241384, "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": 1768488582.6250436, "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": 1768488582.6257327, "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": 1768488582.6265523, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6282215, "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": 1768488582.629073, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6303184, "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": 1768488582.6310384, "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": 1768488582.6316361, "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": 1768488582.632662, "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": 1768488582.634465, "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": 1768488582.6352563, "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": 1768488582.6361682, "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": 1768488582.6377275, "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": 1768488582.6409044, "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": 1768488582.6416779, "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": 1768488582.6423523, "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": 1768488582.643425, "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": 1768488582.6454346, "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": 1768488582.647656, "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": 1768488582.6556082, "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": 1768488582.6566107, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6583374, "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": 1768488582.6594462, "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": 1768488582.6616101, "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": 1768488582.6622703, "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": 1768488582.6635408, "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": 1768488582.6641452, "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": 1768488582.6647906, "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": 1768488582.665357, "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": 1768488582.6662683, "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": 1768488582.667806, "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": 1768488582.6695607, "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": 1768488582.6709368, "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": 1768488582.6738884, "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": 1768488582.6749985, "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": 1768488582.675427, "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": 1768488582.6757863, "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": 1768488582.6761725, "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": 1768488582.6765049, "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": 1768488582.6768537, "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": 1768488582.6771965, "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": 1768488582.6779652, "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": 1768488582.6794145, "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": 1768488582.680248, "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": 1768488582.6811721, "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": 1768488582.681554, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6830294, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6868389, "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": 1768488582.6875188, "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": 1768488582.6880038, "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": 1768488582.6886659, "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": 1768488582.689823, "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": 1768488582.6904087, "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": 1768488582.691086, "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": 1768488582.6916254, "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": 1768488582.6919014, "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": 1768488582.6928172, "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": 1768488582.6939776, "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": 1768488582.6944244, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.6951299, "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": 1768488582.6960452, "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": 1768488582.6977265, "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": 1768488582.6992435, "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": 1768488582.699968, "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": 1768488582.7014232, "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": 1768488582.7028856, "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": 1768488582.7038913, "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": 1768488582.704518, "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": 1768488582.705592, "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": 1768488582.7064903, "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": 1768488582.7081513, "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": 1768488582.7101827, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7172382, "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": 1768488582.7181516, "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": 1768488582.7187097, "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": 1768488582.719815, "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": 1768488582.7214055, "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": 1768488582.7219892, "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": 1768488582.722674, "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": 1768488582.7240393, "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": 1768488582.7269442, "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": 1768488582.7277093, "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": 1768488582.7290678, "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": 1768488582.7299078, "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": 1768488582.7313569, "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": 1768488582.7320013, "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": 1768488582.73228, "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": 1768488582.7325509, "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": 1768488582.7328546, "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": 1768488582.7333722, "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": 1768488582.734411, "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": 1768488582.735153, "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": 1768488582.7357247, "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": 1768488582.7365284, "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": 1768488582.7373505, "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": 1768488582.7377398, "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": 1768488582.738762, "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": 1768488582.7393868, "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": 1768488582.740464, "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": 1768488582.7409902, "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": 1768488582.7413123, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7427607, "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": 1768488582.7436235, "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": 1768488582.7441533, "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": 1768488582.744528, "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": 1768488582.7450266, "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": 1768488582.7453616, "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": 1768488582.7468812, "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": 1768488582.748199, "supported_languages": null}, "macro.salesforce.get_contact_columns": {"name": "get_contact_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_contact_columns.sql", "original_file_path": "macros/staging/get_contact_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.754378, "supported_languages": null}, "macro.salesforce.get_opportunity_columns": {"name": "get_opportunity_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_opportunity_columns.sql", "original_file_path": "macros/staging/get_opportunity_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.760519, "supported_languages": null}, "macro.salesforce.add_renamed_columns": {"name": "add_renamed_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/add_renamed_columns.sql", "original_file_path": "macros/staging/add_renamed_columns.sql", "unique_id": "macro.salesforce.add_renamed_columns", "macro_sql": "{% macro add_renamed_columns(column_list) %}\n{# \n This macro is a step in a workflow applied across models. It appends camelCase spellings to the list of snake_case spellings generated by the `get_*_columns` macro. \n By default, it transforms column names by removing underscores and capitalizing each segment following an underscore. \n Additionally, it tags each column with its renamed version to facilitate tracking and consistency. \n\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\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": 1768488582.7626126, "supported_languages": null}, "macro.salesforce.get_user_role_columns": {"name": "get_user_role_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_user_role_columns.sql", "original_file_path": "macros/staging/get_user_role_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7649632, "supported_languages": null}, "macro.salesforce.get_product_2_columns": {"name": "get_product_2_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_product_2_columns.sql", "original_file_path": "macros/staging/get_product_2_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7700245, "supported_languages": null}, "macro.salesforce.column_list_to_dict": {"name": "column_list_to_dict", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/column_list_to_dict.sql", "original_file_path": "macros/staging/column_list_to_dict.sql", "unique_id": "macro.salesforce.column_list_to_dict", "macro_sql": "{% macro column_list_to_dict(column_list) %}\n\n{# \n This macro is a step in a workflow applied across models. It 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\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\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": 1768488582.7709773, "supported_languages": null}, "macro.salesforce.get_account_columns": {"name": "get_account_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_account_columns.sql", "original_file_path": "macros/staging/get_account_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7776887, "supported_languages": null}, "macro.salesforce.get_order_columns": {"name": "get_order_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_order_columns.sql", "original_file_path": "macros/staging/get_order_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7849598, "supported_languages": null}, "macro.salesforce.get_opportunity_line_item_columns": {"name": "get_opportunity_line_item_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_opportunity_line_item_columns.sql", "original_file_path": "macros/staging/get_opportunity_line_item_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.78998, "supported_languages": null}, "macro.salesforce.get_task_columns": {"name": "get_task_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_task_columns.sql", "original_file_path": "macros/staging/get_task_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.7956681, "supported_languages": null}, "macro.salesforce.get_user_columns": {"name": "get_user_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_user_columns.sql", "original_file_path": "macros/staging/get_user_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.8015766, "supported_languages": null}, "macro.salesforce.get_lead_columns": {"name": "get_lead_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_lead_columns.sql", "original_file_path": "macros/staging/get_lead_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.8098712, "supported_languages": null}, "macro.salesforce.coalesce_rename": {"name": "coalesce_rename", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/coalesce_rename.sql", "original_file_path": "macros/staging/coalesce_rename.sql", "unique_id": "macro.salesforce.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{#\n This macro is the final step in a workflow applied across models. It accommodates Fivetran connectors that retain Salesforce's original field naming conventions, which are camelCase instead of snake_case.\n\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\n\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": 1768488582.811468, "supported_languages": null}, "macro.salesforce.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "patch_path": null, "arguments": [], "created_at": 1768488582.8169928, "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": 1768488582.8178494, "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": 1768488582.8198235, "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": 1768488582.8206165, "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": 1768488582.8209558, "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": 1768488582.8212903, "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": 1768488582.8216345, "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": 1768488582.8219583, "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": 1768488582.8223026, "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": 1768488582.8233943, "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": 1768488582.8239248, "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": 1768488582.8246725, "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": 1768488582.8251925, "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": 1768488582.8254092, "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": 1768488582.825639, "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": 1768488582.8258517, "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": 1768488582.8266292, "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": 1768488582.827088, "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": 1768488582.827403, "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": 1768488582.8277752, "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": 1768488582.8280888, "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": 1768488582.828397, "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": 1768488582.829822, "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": 1768488582.8301604, "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": 1768488582.8304904, "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": 1768488582.8308241, "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": 1768488582.8342555, "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": 1768488582.8349996, "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": 1768488582.836134, "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": 1768488582.8366451, "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": 1768488582.837146, "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": 1768488582.837645, "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": 1768488582.8381298, "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": 1768488582.8386767, "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": 1768488582.8392096, "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": 1768488582.8397026, "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": 1768488582.841795, "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": 1768488582.8429313, "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": 1768488582.848693, "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": 1768488582.849411, "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": 1768488582.850027, "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": 1768488582.8503273, "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": 1768488582.8507447, "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": 1768488582.85123, "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": 1768488582.8514438, "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": 1768488582.8516736, "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": 1768488582.8542237, "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": 1768488582.855169, "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": 1768488582.8575525, "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": 1768488582.8583984, "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": 1768488582.8593898, "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": 1768488582.85972, "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": 1768488582.8602762, "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": 1768488582.8608565, "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": 1768488582.8611233, "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": 1768488582.861381, "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": 1768488582.861654, "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": 1768488582.8619134, "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": 1768488582.8627355, "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": 1768488582.8630114, "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": 1768488582.8632812, "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": 1768488582.8635514, "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": 1768488582.863846, "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": 1768488582.865174, "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": 1768488582.86666, "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": 1768488582.8678815, "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": 1768488582.8698277, "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": 1768488582.870444, "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": 1768488582.8706923, "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": 1768488582.8709378, "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": 1768488582.8711522, "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": 1768488582.8713598, "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": 1768488582.8721225, "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": 1768488582.8725352, "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": 1768488582.8730052, "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": 1768488582.8734784, "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": 1768488582.8737178, "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": 1768488582.873934, "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": 1768488582.8763661, "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": 1768488582.8856294, "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": 1768488582.8865104, "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": 1768488582.8875277, "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": 1768488582.887908, "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": 1768488582.8895144, "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": 1768488582.8907182, "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": 1768488582.8914704, "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": 1768488582.8921986, "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": 1768488582.8933582, "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": 1768488582.8941886, "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": 1768488582.894529, "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": 1768488582.8948796, "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": 1768488582.8952074, "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": 1768488582.895498, "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": 1768488582.895842, "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": "public_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": 1768488583.677293, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "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": "public_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": 1768488583.7101805, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_columns": [{"database": "postgres", "schema": "public_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": "6d72837a85c9cb0e8ad68bb612a6f0983717b120b35d705a1268104b03cdeec1"}, "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": 1768488583.718567, "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!!! */\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "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": "public_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": 1768488583.7256541, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}]}, "parent_map": {"seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_data": [], "model.salesforce.salesforce__contact_daily_history": ["model.salesforce.stg_salesforce__contact_history"], "model.salesforce.salesforce__account_daily_history": ["model.salesforce.stg_salesforce__account_history"], "model.salesforce.salesforce__opportunity_daily_history": ["model.salesforce.stg_salesforce__opportunity_history"], "model.salesforce.stg_salesforce__opportunity_history": ["source.salesforce.salesforce_history.opportunity"], "model.salesforce.stg_salesforce__account_history": ["source.salesforce.salesforce_history.account"], "model.salesforce.stg_salesforce__contact_history": ["source.salesforce.salesforce_history.contact"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["model.salesforce.stg_salesforce__opportunity_line_item", "model.salesforce.stg_salesforce__product_2"], "model.salesforce.salesforce__daily_activity": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.stg_salesforce__event", "model.salesforce.stg_salesforce__lead", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__task"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce.stg_salesforce__account", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role"], "model.salesforce.salesforce__owner_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user"], "model.salesforce.salesforce__sales_snapshot": ["model.salesforce.salesforce__opportunity_enhanced"], "model.salesforce.salesforce__contact_enhanced": ["model.salesforce.stg_salesforce__account", "model.salesforce.stg_salesforce__contact", "model.salesforce.stg_salesforce__user"], "model.salesforce.salesforce__manager_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role"], "model.salesforce.stg_salesforce__opportunity": ["source.salesforce.salesforce.opportunity"], "model.salesforce.stg_salesforce__order": ["source.salesforce.salesforce.order"], "model.salesforce.stg_salesforce__user": ["source.salesforce.salesforce.user"], "model.salesforce.stg_salesforce__task": ["source.salesforce.salesforce.task"], "model.salesforce.stg_salesforce__opportunity_line_item": ["source.salesforce.salesforce.opportunity_line_item"], "model.salesforce.stg_salesforce__user_role": ["source.salesforce.salesforce.user_role"], "model.salesforce.stg_salesforce__event": ["source.salesforce.salesforce.event"], "model.salesforce.stg_salesforce__product_2": ["source.salesforce.salesforce.product_2"], "model.salesforce.stg_salesforce__contact": ["source.salesforce.salesforce.contact"], "model.salesforce.stg_salesforce__lead": ["source.salesforce.salesforce.lead"], "model.salesforce.stg_salesforce__account": ["source.salesforce.salesforce.account"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.stg_salesforce__lead"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.stg_salesforce__user"], "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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": ["model.salesforce.stg_salesforce__account_history"], "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f": ["model.salesforce.stg_salesforce__account_history"], "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": ["model.salesforce.stg_salesforce__contact_history"], "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": ["model.salesforce.stg_salesforce__contact_history"], "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": ["model.salesforce.stg_salesforce__opportunity_history"], "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": ["model.salesforce.stg_salesforce__opportunity_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.not_null_stg_salesforce__account_account_id.1e0ff361d4": ["model.salesforce.stg_salesforce__account"], "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7": ["model.salesforce.stg_salesforce__account"], "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": ["model.salesforce.stg_salesforce__opportunity"], "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": ["model.salesforce.stg_salesforce__opportunity"], "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": ["model.salesforce.stg_salesforce__user"], "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152": ["model.salesforce.stg_salesforce__user"], "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": ["model.salesforce.stg_salesforce__user_role"], "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718": ["model.salesforce.stg_salesforce__user_role"], "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78": ["model.salesforce.stg_salesforce__contact"], "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e": ["model.salesforce.stg_salesforce__contact"], "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": ["model.salesforce.stg_salesforce__event"], "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9": ["model.salesforce.stg_salesforce__event"], "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": ["model.salesforce.stg_salesforce__lead"], "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282": ["model.salesforce.stg_salesforce__lead"], "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": ["model.salesforce.stg_salesforce__opportunity_line_item"], "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": ["model.salesforce.stg_salesforce__opportunity_line_item"], "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f": ["model.salesforce.stg_salesforce__order"], "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c": ["model.salesforce.stg_salesforce__order"], "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": ["model.salesforce.stg_salesforce__product_2"], "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": ["model.salesforce.stg_salesforce__product_2"], "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9": ["model.salesforce.stg_salesforce__task"], "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605": ["model.salesforce.stg_salesforce__task"], "source.salesforce.salesforce_history.account": [], "source.salesforce.salesforce_history.contact": [], "source.salesforce.salesforce_history.opportunity": [], "source.salesforce.salesforce.account": [], "source.salesforce.salesforce.opportunity": [], "source.salesforce.salesforce.user": [], "source.salesforce.salesforce.user_role": [], "source.salesforce.salesforce.contact": [], "source.salesforce.salesforce.event": [], "source.salesforce.salesforce.lead": [], "source.salesforce.salesforce.opportunity_line_item": [], "source.salesforce.salesforce.order": [], "source.salesforce.salesforce.product_2": [], "source.salesforce.salesforce.task": [], "source.salesforce.salesforce.fivetran_formula": [], "source.salesforce.salesforce.fivetran_formula_model": []}, "child_map": {"seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_opportunity_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__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_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.stg_salesforce__opportunity_history": ["model.salesforce.salesforce__opportunity_daily_history", "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67"], "model.salesforce.stg_salesforce__account_history": ["model.salesforce.salesforce__account_daily_history", "test.salesforce.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f"], "model.salesforce.stg_salesforce__contact_history": ["model.salesforce.salesforce__contact_daily_history", "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d"], "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__daily_activity": ["test.salesforce.not_null_salesforce__daily_activity_date_day.154c971cb8", "test.salesforce.unique_salesforce__daily_activity_date_day.288eaadb04"], "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__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__manager_performance": ["test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650"], "model.salesforce.stg_salesforce__opportunity": ["model.salesforce.salesforce__daily_activity", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a"], "model.salesforce.stg_salesforce__order": ["test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f", "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c"], "model.salesforce.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.not_null_stg_salesforce__user_user_id.ac0ab26d65", "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152"], "model.salesforce.stg_salesforce__task": ["model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9", "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605"], "model.salesforce.stg_salesforce__opportunity_line_item": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902"], "model.salesforce.stg_salesforce__user_role": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718"], "model.salesforce.stg_salesforce__event": ["model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8", "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9"], "model.salesforce.stg_salesforce__product_2": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61"], "model.salesforce.stg_salesforce__contact": ["model.salesforce.salesforce__contact_enhanced", "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e"], "model.salesforce.stg_salesforce__lead": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282"], "model.salesforce.stg_salesforce__account": ["model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4", "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.salesforce__daily_activity"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__owner_performance"], "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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": [], "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f": [], "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": [], "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": [], "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": [], "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": [], "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.not_null_stg_salesforce__account_account_id.1e0ff361d4": [], "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7": [], "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": [], "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": [], "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": [], "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152": [], "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": [], "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718": [], "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78": [], "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e": [], "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": [], "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9": [], "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": [], "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282": [], "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": [], "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": [], "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f": [], "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c": [], "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": [], "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": [], "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9": [], "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605": [], "source.salesforce.salesforce_history.account": ["model.salesforce.stg_salesforce__account_history"], "source.salesforce.salesforce_history.contact": ["model.salesforce.stg_salesforce__contact_history"], "source.salesforce.salesforce_history.opportunity": ["model.salesforce.stg_salesforce__opportunity_history"], "source.salesforce.salesforce.account": ["model.salesforce.stg_salesforce__account"], "source.salesforce.salesforce.opportunity": ["model.salesforce.stg_salesforce__opportunity"], "source.salesforce.salesforce.user": ["model.salesforce.stg_salesforce__user"], "source.salesforce.salesforce.user_role": ["model.salesforce.stg_salesforce__user_role"], "source.salesforce.salesforce.contact": ["model.salesforce.stg_salesforce__contact"], "source.salesforce.salesforce.event": ["model.salesforce.stg_salesforce__event"], "source.salesforce.salesforce.lead": ["model.salesforce.stg_salesforce__lead"], "source.salesforce.salesforce.opportunity_line_item": ["model.salesforce.stg_salesforce__opportunity_line_item"], "source.salesforce.salesforce.order": ["model.salesforce.stg_salesforce__order"], "source.salesforce.salesforce.product_2": ["model.salesforce.stg_salesforce__product_2"], "source.salesforce.salesforce.task": ["model.salesforce.stg_salesforce__task"], "source.salesforce.salesforce.fivetran_formula": [], "source.salesforce.salesforce.fivetran_formula_model": []}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file +{"metadata": {"dbt_schema_version": "https://schemas.getdbt.com/dbt/manifest/v12.json", "dbt_version": "1.11.12", "generated_at": "2026-07-15T16:25:25.077303Z", "invocation_id": "81fc0df1-bf08-45d1-930f-412ffdb89e1b", "invocation_started_at": "2026-07-15T16:25:12.378455+00:00", "env": {}, "project_name": "salesforce_integration_tests", "project_id": "587a8ff6488a773aca368d80d6016991", "user_id": null, "send_anonymous_usage_stats": false, "adapter_type": "postgres", "quoting": {"database": true, "schema": true, "identifier": true, "column": null}, "run_started_at": "2026-07-15T16:25:12.378738+00:00"}, "nodes": {"seed.salesforce_integration_tests.sf_opportunity_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0576413, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_role_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}"}, "created_at": 1784132715.0656574, "relation_name": "\"postgres\".\"public\".\"sf_user_role_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_history_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0692322, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_campaign_history_data": {"database": "postgres", "schema": "public", "name": "sf_campaign_history_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_campaign_history_data.csv", "original_file_path": "seeds/sf_campaign_history_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_campaign_history_data", "fqn": ["salesforce_integration_tests", "sf_campaign_history_data"], "alias": "sf_campaign_history_data", "checksum": {"name": "sha256", "checksum": "3ea9f49b1bba9767477a19655a6118440c0b35bd8fad855cdbde04a7dfedb83b"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "_fivetran_start": "timestamp", "_fivetran_end": "timestamp", "start_date": "timestamp", "end_date": "timestamp", "is_active": "boolean", "is_deleted": "boolean", "budgeted_cost": "float", "actual_cost": "float", "number_of_leads": "integer", "number_of_converted_leads": "integer", "number_of_contacts": "integer", "number_of_responses": "integer", "number_of_opportunities": "integer", "number_of_won_opportunities": "integer", "amount_all_opportunities": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "_fivetran_start": "timestamp", "_fivetran_end": "timestamp", "start_date": "timestamp", "end_date": "timestamp", "is_active": "boolean", "is_deleted": "boolean", "budgeted_cost": "float", "actual_cost": "float", "number_of_leads": "integer", "number_of_converted_leads": "integer", "number_of_contacts": "integer", "number_of_responses": "integer", "number_of_opportunities": "integer", "number_of_won_opportunities": "integer", "amount_all_opportunities": "float"}}, "created_at": 1784132715.0731266, "relation_name": "\"postgres\".\"public\".\"sf_campaign_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_history_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "last_activity_date": "timestamp", "last_modified_date": "timestamp", "last_viewed_date": "timestamp", "is_deleted": "boolean"}}, "created_at": 1784132715.0767424, "relation_name": "\"postgres\".\"public\".\"sf_contact_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_history_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0802848, "relation_name": "\"postgres\".\"public\".\"sf_account_history_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_product_2_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0838184, "relation_name": "\"postgres\".\"public\".\"sf_product_2_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_campaign_member_data": {"database": "postgres", "schema": "public", "name": "sf_campaign_member_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_campaign_member_data.csv", "original_file_path": "seeds/sf_campaign_member_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_campaign_member_data", "fqn": ["salesforce_integration_tests", "sf_campaign_member_data"], "alias": "sf_campaign_member_data", "checksum": {"name": "sha256", "checksum": "58e4dc05e4498ccee005df1510f4921af0230e0e47dfe5eaf9758b3d4d2d1fe2"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "first_responded_date": "timestamp", "has_responded": "boolean", "is_deleted": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "created_date": "timestamp", "first_responded_date": "timestamp", "has_responded": "boolean", "is_deleted": "boolean"}}, "created_at": 1784132715.0873773, "relation_name": "\"postgres\".\"public\".\"sf_campaign_member_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_opportunity_line_item_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0910954, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_line_item_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_event_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "activity_date_time": "timestamp", "created_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "activity_date": "timestamp", "activity_date_time": "timestamp", "created_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": 1784132715.0947764, "relation_name": "\"postgres\".\"public\".\"sf_event_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_account_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.0984175, "relation_name": "\"postgres\".\"public\".\"sf_account_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_lead_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.102024, "relation_name": "\"postgres\".\"public\".\"sf_lead_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_contact_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "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": 1784132715.105773, "relation_name": "\"postgres\".\"public\".\"sf_contact_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_order_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.109429, "relation_name": "\"postgres\".\"public\".\"sf_order_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_record_type_data": {"database": "postgres", "schema": "public", "name": "sf_record_type_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_record_type_data.csv", "original_file_path": "seeds/sf_record_type_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_record_type_data", "fqn": ["salesforce_integration_tests", "sf_record_type_data"], "alias": "sf_record_type_data", "checksum": {"name": "sha256", "checksum": "2ef616e92f085dbea8d6a20fca971078033d15a60e3b90d4c917b44a71b18b45"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_deleted": "boolean", "is_active": "boolean"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_deleted": "boolean", "is_active": "boolean"}}, "created_at": 1784132715.1129315, "relation_name": "\"postgres\".\"public\".\"sf_record_type_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_user_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.116408, "relation_name": "\"postgres\".\"public\".\"sf_user_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_task_data": {"database": "postgres", "schema": "public", "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, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_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": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "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"}}, "created_at": 1784132715.1201472, "relation_name": "\"postgres\".\"public\".\"sf_task_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "seed.salesforce_integration_tests.sf_campaign_data": {"database": "postgres", "schema": "public", "name": "sf_campaign_data", "resource_type": "seed", "package_name": "salesforce_integration_tests", "path": "sf_campaign_data.csv", "original_file_path": "seeds/sf_campaign_data.csv", "unique_id": "seed.salesforce_integration_tests.sf_campaign_data", "fqn": ["salesforce_integration_tests", "sf_campaign_data"], "alias": "sf_campaign_data", "checksum": {"name": "sha256", "checksum": "793357fcff4662ed5cf6dbdf8f282d8821ab60dcdeff8905d5c7093f339445c0"}, "config": {"enabled": true, "alias": null, "schema": null, "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "seed", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "start_date": "timestamp", "end_date": "timestamp", "is_active": "boolean", "is_deleted": "boolean", "budgeted_cost": "float", "actual_cost": "float", "number_of_leads": "integer", "number_of_converted_leads": "integer", "number_of_contacts": "integer", "number_of_responses": "integer", "number_of_opportunities": "integer", "number_of_won_opportunities": "integer", "amount_all_opportunities": "float"}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": false, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "delimiter": ",", "quote_columns": true}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": false, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"docs": {"show": false}, "quote_columns": "{{ true if target.type in ('redshift', 'postgres') else false }}", "column_types": {"_fivetran_synced": "timestamp", "_fivetran_active": "boolean", "start_date": "timestamp", "end_date": "timestamp", "is_active": "boolean", "is_deleted": "boolean", "budgeted_cost": "float", "actual_cost": "float", "number_of_leads": "integer", "number_of_converted_leads": "integer", "number_of_contacts": "integer", "number_of_responses": "integer", "number_of_opportunities": "integer", "number_of_won_opportunities": "integer", "amount_all_opportunities": "float"}}, "created_at": 1784132715.123823, "relation_name": "\"postgres\".\"public\".\"sf_campaign_data\"", "raw_code": "", "doc_blocks": [], "root_path": "/home/runner/work/dbt_salesforce/dbt_salesforce/integration_tests", "depends_on": {"macros": []}}, "model.salesforce.salesforce__campaign_performance": {"database": "postgres", "schema": "public_salesforce_dev", "name": "salesforce__campaign_performance", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/salesforce__campaign_performance.sql", "original_file_path": "models/salesforce/salesforce__campaign_performance.sql", "unique_id": "model.salesforce.salesforce__campaign_performance", "fqn": ["salesforce", "salesforce", "salesforce__campaign_performance"], "alias": "salesforce__campaign_performance", "checksum": {"name": "sha256", "checksum": "eff2b9721a3ae5c8c48cffcdaeba316833a11449e47ff43eed2a97bfa6c652d1"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "Each record represents a campaign, enriched with pipeline, revenue, member volume, conversion rates, and ROI metrics.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "Name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "Type of campaign, such as Direct Mail, Email, or Webinar.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_status": {"name": "campaign_status", "description": "Status of the campaign, such as Planned, In Progress, or Completed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "start_date": {"name": "start_date", "description": "Starting date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Ending date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether the campaign is active (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_campaign_id": {"name": "parent_campaign_id", "description": "The ID of the parent campaign, if applicable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "budgeted_cost": {"name": "budgeted_cost", "description": "Amount of money budgeted for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "actual_cost": {"name": "actual_cost", "description": "Amount of money spent to run the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_leads": {"name": "number_of_leads", "description": "Number of leads associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_converted_leads": {"name": "number_of_converted_leads", "description": "Number of leads associated with the campaign that have been converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_contacts": {"name": "number_of_contacts", "description": "Number of contacts associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_responses": {"name": "number_of_responses", "description": "Number of contacts and leads that responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_opportunities": {"name": "number_of_opportunities", "description": "Number of opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_won_opportunities": {"name": "number_of_won_opportunities", "description": "Number of closed-won opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "Total amount of all open and closed opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_record_type_name": {"name": "campaign_member_record_type_name", "description": "Name of the campaign member record type associated with this campaign. Only present if the record_type table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_count": {"name": "campaign_member_count", "description": "Total number of campaign members (contacts and leads) associated with this campaign. Only present if the campaign_member table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opted_out_of_email_count": {"name": "opted_out_of_email_count", "description": "Number of campaign members who have opted out of email communications. Only present if the campaign_member table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "responded_count": {"name": "responded_count", "description": "Number of campaign members who have responded to the campaign. Only present if the campaign_member table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "contact_count": {"name": "contact_count", "description": "Number of campaign members who are contacts. Only present if the campaign_member table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_count": {"name": "lead_count", "description": "Number of campaign members who are leads. Only present if the campaign_member table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_won_amount": {"name": "total_won_amount", "description": "Sum of the closed-won opportunity amounts where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "win_rate": {"name": "win_rate", "description": "Ratio of won opportunities to total opportunities. Null if there are no opportunities.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "cost_per_opportunity": {"name": "cost_per_opportunity", "description": "Actual cost divided by the number of opportunities. Null if actual cost is not set.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "cost_per_won_opportunity": {"name": "cost_per_won_opportunity", "description": "Actual cost divided by the number of won opportunities. Null if actual cost is not set.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "roi": {"name": "roi", "description": "Return on investment, calculated as (total_won_amount - actual_cost) / actual_cost. Null if actual cost is not set.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "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, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.676797, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_performance\"", "raw_code": "--This model will only run if you have the underlying campaign table.\n{{ config(enabled=var('salesforce__campaign_enabled', True)) }}\n\n{% set campaign_member_enabled = var('salesforce__campaign_member_enabled', True) %}\n{% set record_type_enabled = var('salesforce__record_type_enabled', True) %}\n\nwith campaign as (\n\n select *\n from {{ ref('stg_salesforce__campaign') }}\n),\n\nopportunity as (\n\n select\n campaign_id,\n sum(coalesce(amount, 0)) as total_won_amount\n from {{ ref('stg_salesforce__opportunity') }}\n where is_won = true\n and campaign_id is not null\n group by 1\n),\n\n{% if campaign_member_enabled %}\ncampaign_member as (\n\n select\n campaign_id,\n count(*) as campaign_member_count,\n count(contact_id) as contact_count,\n count(lead_id) as lead_count,\n sum(case when has_opted_out_of_email then 1 else 0 end) as opted_out_of_email_count,\n sum(case when has_responded then 1 else 0 end) as responded_count\n from {{ ref('stg_salesforce__campaign_member') }}\n group by 1\n),\n{% endif %}\n\n{% if record_type_enabled %}\nrecord_type as (\n\n select *\n from {{ ref('stg_salesforce__record_type') }}\n where lower(sobject_type) = 'campaignmember'\n),\n{% endif %}\n\nfinal as (\n\n select\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.campaign_status,\n campaign.start_date,\n campaign.end_date,\n campaign.is_active,\n campaign.parent_campaign_id,\n campaign.budgeted_cost,\n campaign.actual_cost,\n campaign.number_of_leads,\n campaign.number_of_converted_leads,\n campaign.number_of_contacts,\n campaign.number_of_responses,\n campaign.number_of_opportunities,\n campaign.number_of_won_opportunities,\n campaign.total_pipeline_amount,\n\n {% if campaign_member_enabled %}\n campaign_member.campaign_member_count,\n campaign_member.opted_out_of_email_count,\n campaign_member.responded_count,\n campaign_member.contact_count,\n campaign_member.lead_count,\n {% endif %}\n\n {% if record_type_enabled %}\n record_type.record_type_name as campaign_member_record_type_name,\n {% endif %}\n\n opportunity.total_won_amount,\n\n -- Derived metrics\n {{ dbt_utils.safe_divide('campaign.number_of_won_opportunities', 'campaign.number_of_opportunities') }} as win_rate,\n {{ dbt_utils.safe_divide('campaign.actual_cost', 'campaign.number_of_opportunities') }} as cost_per_opportunity,\n {{ dbt_utils.safe_divide('campaign.actual_cost', 'campaign.number_of_won_opportunities') }} as cost_per_won_opportunity,\n {{ dbt_utils.safe_divide('(opportunity.total_won_amount - campaign.actual_cost)', 'campaign.actual_cost') }} as roi\n\n {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__campaign_pass_through_columns', identifier='campaign') }}\n\n from campaign\n left join opportunity\n on campaign.campaign_id = opportunity.campaign_id\n \n {% if campaign_member_enabled %}\n left join campaign_member\n on campaign.campaign_id = campaign_member.campaign_id\n {% endif %}\n\n {% if record_type_enabled %}\n left join record_type\n on campaign.campaign_member_record_type_id = record_type.record_type_id\n {% endif %}\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__campaign", "package": null, "version": null}, {"name": "stg_salesforce__opportunity", "package": null, "version": null}, {"name": "stg_salesforce__campaign_member", "package": null, "version": null}, {"name": "stg_salesforce__record_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.safe_divide", "macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__campaign", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__campaign_member", "model.salesforce.stg_salesforce__record_type"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__campaign_performance.sql", "compiled": true, "compiled_code": "--This model will only run if you have the underlying campaign table.\n\n\n\n\n\nwith campaign as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign\"\n),\n\nopportunity as (\n\n select\n campaign_id,\n sum(coalesce(amount, 0)) as total_won_amount\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__opportunity\"\n where is_won = true\n and campaign_id is not null\n group by 1\n),\n\n\ncampaign_member as (\n\n select\n campaign_id,\n count(*) as campaign_member_count,\n count(contact_id) as contact_count,\n count(lead_id) as lead_count,\n sum(case when has_opted_out_of_email then 1 else 0 end) as opted_out_of_email_count,\n sum(case when has_responded then 1 else 0 end) as responded_count\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign_member\"\n group by 1\n),\n\n\n\nrecord_type as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__record_type\"\n where lower(sobject_type) = 'campaignmember'\n),\n\n\nfinal as (\n\n select\n campaign.campaign_id,\n campaign.campaign_name,\n campaign.campaign_type,\n campaign.campaign_status,\n campaign.start_date,\n campaign.end_date,\n campaign.is_active,\n campaign.parent_campaign_id,\n campaign.budgeted_cost,\n campaign.actual_cost,\n campaign.number_of_leads,\n campaign.number_of_converted_leads,\n campaign.number_of_contacts,\n campaign.number_of_responses,\n campaign.number_of_opportunities,\n campaign.number_of_won_opportunities,\n campaign.total_pipeline_amount,\n\n \n campaign_member.campaign_member_count,\n campaign_member.opted_out_of_email_count,\n campaign_member.responded_count,\n campaign_member.contact_count,\n campaign_member.lead_count,\n \n\n \n record_type.record_type_name as campaign_member_record_type_name,\n \n\n opportunity.total_won_amount,\n\n -- Derived metrics\n \n ( campaign.number_of_won_opportunities ) / nullif( ( campaign.number_of_opportunities ), 0)\n as win_rate,\n \n ( campaign.actual_cost ) / nullif( ( campaign.number_of_opportunities ), 0)\n as cost_per_opportunity,\n \n ( campaign.actual_cost ) / nullif( ( campaign.number_of_won_opportunities ), 0)\n as cost_per_won_opportunity,\n \n ( (opportunity.total_won_amount - campaign.actual_cost) ) / nullif( ( campaign.actual_cost ), 0)\n as roi\n\n \n\n\n\n\n\n from campaign\n left join opportunity\n on campaign.campaign_id = opportunity.campaign_id\n \n \n left join campaign_member\n on campaign.campaign_id = campaign_member.campaign_id\n \n\n \n left join record_type\n on campaign.campaign_member_record_type_id = record_type.record_type_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, "primary_key": ["campaign_id"], "time_spine": null}, "model.salesforce.salesforce__daily_activity": {"database": "postgres", "schema": "public_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": "417cf6b8adf43a5ad39f54692076d07d44b915ead48d2671420109f643bb17c9"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.date_day"]}, "leads_created": {"name": "leads_created", "description": "Number of leads created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.leads_created"]}, "leads_converted": {"name": "leads_converted", "description": "Number of leads converted on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.leads_converted"]}, "tasks_completed": {"name": "tasks_completed", "description": "Number of tasks for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.tasks_completed"]}, "events_completed": {"name": "events_completed", "description": "Number of events for that activity date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.events_completed"]}, "opportunities_created": {"name": "opportunities_created", "description": "Number of opportunities created on that date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_created"]}, "opportunities_won": {"name": "opportunities_won", "description": "Number of opportunities won on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_won"]}, "opportunities_lost": {"name": "opportunities_lost", "description": "Number of opportunities lost on that close date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_lost"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_created_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_won_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunities_lost_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_amount"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6552217, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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 {{ ref('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 {% 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": ["macro.dbt.date_trunc"], "nodes": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.stg_salesforce__task", "model.salesforce.stg_salesforce__event", "model.salesforce.stg_salesforce__lead", "model.salesforce.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\".\"public_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\".\"public_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\".\"public_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\".\"public_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\".\"public_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\".\"public_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, "primary_key": ["date_day"], "time_spine": null}, "model.salesforce.salesforce__contact_enhanced": {"database": "postgres", "schema": "public_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": "c981358e10dc974676df279c9c1ff6cd2590373b8403cfb933e643c09980783e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_id"]}, "contact_name": {"name": "contact_name", "description": "Name of contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_name"]}, "account_id": {"name": "account_id", "description": "ID of contact's account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_id"]}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.department"]}, "contact_description": {"name": "contact_description", "description": "A description of the contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_description"]}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.email"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.individual_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.last_activity_date"]}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lead_source"]}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_city"]}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_country"]}, "mailing_country_code": {"name": "mailing_country_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_country_code"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_postal_code"]}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_state"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_state_code"]}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mailing_street"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.master_record_id"]}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.mobile_phone"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_owner_id"]}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.phone"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.reports_to_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.contact_owner_name"]}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_name"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_number"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_source"]}, "account_annual_revenue": {"name": "account_annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_annual_revenue"]}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_description"]}, "account_industry": {"name": "account_industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_industry"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_number_of_employees"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_owner_id"]}, "account_parent_id": {"name": "account_parent_id", "description": "ID of the account parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_parent_id"]}, "account_rating": {"name": "account_rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_rating"]}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.account_type"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6502109, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__contact_enhanced\"", "raw_code": "with contact as (\n\n select *\n from {{ ref('stg_salesforce__contact') }}\n), \n\naccount as (\n\n select *\n from {{ ref('stg_salesforce__account') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ ref('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 {{ 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__contact", "model.salesforce.stg_salesforce__account", "model.salesforce.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\".\"public_salesforce_dev\".\"stg_salesforce__contact\"\n), \n\naccount as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__account\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["contact_id"], "time_spine": null}, "model.salesforce.salesforce__owner_performance": {"database": "postgres", "schema": "public_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": "150500c5f4e22d26a0e8f15ca3e16243798351c02e44e0eaecd5c029d308a560"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.owner_id"]}, "avg_bookings_amount": {"name": "avg_bookings_amount", "description": "The average opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_bookings_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_open"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_to_close"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_pipeline_opp_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "manager_id": {"name": "manager_id", "description": "Manager ID associated with opportunities.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_city": {"name": "owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_name": {"name": "owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_state": {"name": "owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6115024, "relation_name": "\"postgres\".\"public_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 {{ ref('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", "doc_blocks": [], "language": "sql", "refs": [{"name": "int_salesforce__opportunity_aggregation_by_owner", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.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\".\"public_salesforce_dev\".\"int_salesforce__opportunity_aggregation_by_owner\" \n), \n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["owner_id"], "time_spine": null}, "model.salesforce.salesforce__opportunity_line_item_enhanced": {"database": "postgres", "schema": "public_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": "726beec62717156effa738674bd806fd705900d5870f56001d359e9b21d72d7c"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_line_item_name"]}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_line_item_description"]}, "opportunity_id": {"name": "opportunity_id", "description": "ID of the associated Opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.opportunity_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.line_item_index"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_line_items"]}, "created_date": {"name": "created_date", "description": "Created date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.created_date"]}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.last_modified_date"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.service_date"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pricebook_entry_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_id"]}, "product_2_name": {"name": "product_2_name", "description": "Default name of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_name"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_code"]}, "product_2_description": {"name": "product_2_description", "description": "A text description of the product.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_2_description"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.list_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.quantity"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.unit_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_price"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.has_quantity_schedule"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.has_revenue_schedule"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_external_id"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_family"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_active"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_archived"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_is_deleted"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_number_of_quantity_installments"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_installment_period"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_schedule_type"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_quantity_unit_of_measure"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_number_of_revenue_installments"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_revenue_installment_period"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.product_revenue_schedule_type"]}}, "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, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6667264, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}, {"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item", "model.salesforce.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\".\"public_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\".\"public_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, "primary_key": ["opportunity_line_item_id"], "time_spine": null}, "model.salesforce.salesforce__sales_snapshot": {"database": "postgres", "schema": "public_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, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_bookings_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_open"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_days_to_close"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.avg_pipeline_opp_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6381948, "relation_name": "\"postgres\".\"public_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", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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, "primary_key": [], "time_spine": null}, "model.salesforce.salesforce__opportunity_enhanced": {"database": "postgres", "schema": "public_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": "ab90c8860e2f70dd43f374af6aa12f63d04e11ec2365b22975f33c6fc1dd4e7b"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_number": {"name": "account_number", "description": "Number of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_type": {"name": "account_type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_record_type_name": {"name": "opportunity_record_type_name", "description": "Name of the record type assigned to this opportunity. Only present if the record_type table is enabled.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_amount_this_month": {"name": "closed_amount_this_month", "description": "The opportunity amount, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_amount_this_quarter": {"name": "closed_amount_this_quarter", "description": "The opportunity amount, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_count_this_month": {"name": "closed_count_this_month", "description": "The opportunity count, if closed this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "closed_count_this_quarter": {"name": "closed_count_this_quarter", "description": "The opportunity count, if closed this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_amount_this_month": {"name": "created_amount_this_month", "description": "The opportunity amount, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_amount_this_quarter": {"name": "created_amount_this_quarter", "description": "The opportunity amount, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_count_this_month": {"name": "created_count_this_month", "description": "The opportunity count, if created this month.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_count_this_quarter": {"name": "created_count_this_quarter", "description": "The opportunity count, if created this quarter.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_account_id": {"name": "opportunity_account_id", "description": "The id of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_city": {"name": "opportunity_manager_city", "description": "The city associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_id": {"name": "opportunity_manager_id", "description": "The Id of the user who manages this owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_name": {"name": "opportunity_manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_manager_state": {"name": "opportunity_manager_state", "description": "The state associated with the owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_city": {"name": "opportunity_owner_city", "description": "The city associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_name": {"name": "opportunity_owner_name", "description": "The first and last name of the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_state": {"name": "opportunity_owner_state", "description": "The state associated with the owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "Id of the owner of this opportunity", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.owner_id"]}, "status": {"name": "status", "description": "Whether the opportunity is won, lost, in the pipeline, or other.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_owner_position": {"name": "opportunity_owner_position", "description": "Name of the position of the opportunity owner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.6362033, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__opportunity_enhanced\"", "raw_code": "{% set record_type_enabled = var('salesforce__record_type_enabled', True) %}\n\nwith opportunity as (\n\n select *\n from {{ ref('stg_salesforce__opportunity') }}\n),\n\nsalesforce_user as (\n\n select *\n from {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__user_role') }}\n), \n{% endif %}\n\naccount as (\n\n select *\n from {{ ref('stg_salesforce__account') }}\n),\n\n{% if record_type_enabled %}\nrecord_type as (\n\n select *\n from {{ ref('stg_salesforce__record_type') }}\n where lower(sobject_type) = 'opportunity'\n),\n{% endif %}\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 {% if record_type_enabled %}\n record_type.record_type_name as opportunity_record_type_name,\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 {% if record_type_enabled %}\n left join record_type\n on opportunity.record_type_id = record_type.record_type_id\n {% endif %}\n)\n\nselect *\nfrom add_fields", "doc_blocks": [], "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}, {"name": "stg_salesforce__record_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.fivetran_utils.persist_pass_through_columns", "macro.salesforce.custom_persist_pass_through_columns"], "nodes": ["model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role", "model.salesforce.stg_salesforce__account", "model.salesforce.stg_salesforce__record_type"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce__opportunity_enhanced.sql", "compiled": true, "compiled_code": "\n\nwith opportunity as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__opportunity\"\n),\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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\".\"public_salesforce_dev\".\"stg_salesforce__user_role\"\n), \n\n\naccount as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__account\"\n),\n\n\nrecord_type as (\n\n select *\n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__record_type\"\n where lower(sobject_type) = 'opportunity'\n),\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 \n record_type.record_type_name as opportunity_record_type_name,\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 \n left join record_type\n on opportunity.record_type_id = record_type.record_type_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, "primary_key": ["opportunity_id"], "time_spine": null}, "model.salesforce.salesforce__manager_performance": {"database": "postgres", "schema": "public_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": "9b95235b1da7f00fac081087c9d3b2a75f5420f29bfbb3f743482773dbcb773e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_amount_closed_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.bookings_count_closed_this_quarter"]}, "largest_booking": {"name": "largest_booking", "description": "The largest amount associated with a single opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_booking"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.largest_deal_in_pipeline"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.lost_count_this_quarter"]}, "manager_city": {"name": "manager_city", "description": "The city location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_name": {"name": "manager_name", "description": "The name of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_position": {"name": "manager_position", "description": "The position role of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_state": {"name": "manager_state", "description": "The state location of the opportunity owner's manager.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_count_created_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_amount_this_quarter"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.pipeline_created_forecast_amount_this_quarter"]}, "total_bookings_amount": {"name": "total_bookings_amount", "description": "The opportunity amount, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_bookings_amount"]}, "total_lost_amount": {"name": "total_lost_amount", "description": "The opportunity amount, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_lost_amount"]}, "total_number_bookings": {"name": "total_number_bookings", "description": "The opportunity count, if status is won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_bookings"]}, "total_number_lost": {"name": "total_number_lost", "description": "The opportunity count, if status is lost.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_lost"]}, "total_number_pipeline": {"name": "total_number_pipeline", "description": "The opportunity count, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_number_pipeline"]}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "The opportunity amount, if status is pipeline.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_pipeline_forecast_amount"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.total_win_percent"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_month"]}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": ["doc.salesforce.win_percent_this_quarter"]}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.603716, "relation_name": "\"postgres\".\"public_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 {{ ref('stg_salesforce__user_role') }}\n),\n{% endif %}\n\nsalesforce_user as (\n\n select *\n from {{ ref('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 {% 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", "doc_blocks": [], "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": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user_role", "model.salesforce.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\".\"public_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\".\"public_salesforce_dev\".\"stg_salesforce__user_role\"\n),\n\n\nsalesforce_user as (\n\n select *\n from \"postgres\".\"public_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, "primary_key": ["manager_id"], "time_spine": null}, "model.salesforce.stg_salesforce__user": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__user", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__user.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__user.sql", "unique_id": "model.salesforce.stg_salesforce__user", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__user"], "alias": "stg_salesforce__user", "checksum": {"name": "sha256", "checksum": "8448fe8529c88533e85f058f8e9d6c3d52275700a8aeef7e0911069190e6fa00"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_name": {"name": "user_name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.007432, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"alias\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"city\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"company_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"contact_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"country\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"country_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"department\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"email\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"first_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"id\", user_dict, alias=\"user_id\" ) }},\n {{ salesforce.coalesce_rename(\"individual_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"is_active\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_login_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_name\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"manager_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"name\", user_dict, alias=\"user_name\" ) }},\n {{ salesforce.coalesce_rename(\"postal_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"profile_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"state\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"state_code\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"street\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"title\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"user_role_id\", user_dict ) }},\n {{ salesforce.coalesce_rename(\"user_type\", user_dict ) }},\n {{ salesforce.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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "user"], ["salesforce", "user"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_user_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__user.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_active as _fivetran_active,\n _fivetran_synced as _fivetran_synced,\n account_id as account_id,\n alias as alias,\n city as city,\n company_name as company_name,\n contact_id as contact_id,\n country as country,\n country_code as country_code,\n department as department,\n email as email,\n first_name as first_name,\n id as id,\n individual_id as individual_id,\n is_active as is_active,\n last_login_date as last_login_date,\n last_name as last_name,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n manager_id as manager_id,\n name as name,\n postal_code as postal_code,\n profile_id as profile_id,\n state as state,\n state_code as state_code,\n street as street,\n title as title,\n user_role_id as user_role_id,\n user_type as user_type,\n username as username,\n cast(null as TEXT) as AccountId,\n cast(null as TEXT) as CompanyName,\n cast(null as TEXT) as ContactId,\n cast(null as TEXT) as CountryCode,\n cast(null as TEXT) as FirstName,\n cast(null as TEXT) as IndividualId,\n cast(null as boolean) as IsActive,\n cast(null as timestamp) as LastLoginDate,\n cast(null as TEXT) as LastName,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as ManagerId,\n cast(null as TEXT) as PostalCode,\n cast(null as TEXT) as ProfileId,\n cast(null as TEXT) as StateCode,\n cast(null as TEXT) as UserRoleId,\n cast(null as TEXT) as UserType\n\n from \"postgres\".\"public\".\"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, "primary_key": ["user_id"], "time_spine": null}, "model.salesforce.stg_salesforce__lead": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__lead", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__lead.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__lead.sql", "unique_id": "model.salesforce.stg_salesforce__lead", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__lead"], "alias": "stg_salesforce__lead", "checksum": {"name": "sha256", "checksum": "1ce4e0480404d2a3b7784804d5b99d3d04f0fadc7a4d6e9cf4ba5ac935391a48"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_description": {"name": "lead_description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0172958, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", lead_dict, alias=\"lead_id\") }},\n {{ salesforce.coalesce_rename(\"annual_revenue\", lead_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"city\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"company\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_account_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_contact_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"converted_opportunity_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"country\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"country_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"description\", lead_dict, alias=\"lead_description\") }},\n {{ salesforce.coalesce_rename(\"email\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"email_bounced_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"email_bounced_reason\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"first_name\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"has_opted_out_of_email\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"individual_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"industry\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_converted\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"is_unread_by_owner\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_name\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"mobile_phone\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"name\", lead_dict, alias=\"lead_name\") }},\n {{ salesforce.coalesce_rename(\"number_of_employees\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"phone\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"postal_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"state\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"state_code\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"status\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"street\", lead_dict) }},\n {{ salesforce.coalesce_rename(\"title\", lead_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "lead"], ["salesforce", "lead"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_lead_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n annual_revenue as annual_revenue,\n city as city,\n company as company,\n converted_account_id as converted_account_id,\n converted_contact_id as converted_contact_id,\n converted_date as converted_date,\n converted_opportunity_id as converted_opportunity_id,\n country as country,\n country_code as country_code,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n email as email,\n email_bounced_date as email_bounced_date,\n email_bounced_reason as email_bounced_reason,\n first_name as first_name,\n has_opted_out_of_email as has_opted_out_of_email,\n id as id,\n individual_id as individual_id,\n industry as industry,\n is_converted as is_converted,\n is_deleted as is_deleted,\n is_unread_by_owner as is_unread_by_owner,\n last_activity_date as last_activity_date,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n last_name as last_name,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n lead_source as lead_source,\n master_record_id as master_record_id,\n mobile_phone as mobile_phone,\n name as name,\n number_of_employees as number_of_employees,\n owner_id as owner_id,\n phone as phone,\n postal_code as postal_code,\n state as state,\n state_code as state_code,\n status as status,\n street as street,\n title as title,\n website as website,\n cast(null as float) as AnnualRevenue,\n cast(null as TEXT) as ConvertedAccountId,\n cast(null as TEXT) as ConvertedContactId,\n cast(null as timestamp) as ConvertedDate,\n cast(null as TEXT) as ConvertedOpportunityId,\n cast(null as TEXT) as CountryCode,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as timestamp) as EmailBouncedDate,\n cast(null as TEXT) as EmailBouncedReason,\n cast(null as TEXT) as FirstName,\n cast(null as boolean) as HasOptedOutOfEmail,\n cast(null as TEXT) as IndividualId,\n cast(null as boolean) as IsConverted,\n cast(null as boolean) as IsDeleted,\n cast(null as boolean) as IsUnreadByOwner,\n cast(null as timestamp) as LastActivityDate,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as TEXT) as LastName,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as LeadSource,\n cast(null as TEXT) as MasterRecordId,\n cast(null as TEXT) as MobilePhone,\n cast(null as integer) as NumberOfEmployees,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as PostalCode,\n cast(null as TEXT) as StateCode\n \n from \"postgres\".\"public\".\"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, "primary_key": ["lead_id"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__opportunity.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__opportunity.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__opportunity"], "alias": "stg_salesforce__opportunity", "checksum": {"name": "sha256", "checksum": "c6e74b46174aa1cbb7dc91f34e363863638304eb2cfaed434ffe1214e60d56ca"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.002882, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"amount\", opportunity_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"campaign_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"close_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"description\", opportunity_dict, alias=\"opportunity_description\") }},\n {{ salesforce.coalesce_rename(\"expected_revenue\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal_quarter\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"fiscal_year\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"forecast_category\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"forecast_category_name\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_open_activity\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_opportunity_line_item\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"has_overdue_task\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"id\", opportunity_dict, alias=\"opportunity_id\") }},\n {{ salesforce.coalesce_rename(\"is_closed\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"is_won\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"name\", opportunity_dict, alias=\"opportunity_name\") }},\n {{ salesforce.coalesce_rename(\"next_step\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"probability\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"stage_name\", opportunity_dict) }},\n {{ salesforce.coalesce_rename(\"synced_quote_id\", opportunity_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "opportunity"], ["salesforce", "opportunity"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_opportunity_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.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.salesforce.opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__opportunity.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_id as account_id,\n amount as amount,\n campaign_id as campaign_id,\n close_date as close_date,\n created_date as created_date,\n description as description,\n expected_revenue as expected_revenue,\n fiscal as fiscal,\n fiscal_quarter as fiscal_quarter,\n fiscal_year as fiscal_year,\n forecast_category as forecast_category,\n forecast_category_name as forecast_category_name,\n has_open_activity as has_open_activity,\n has_opportunity_line_item as has_opportunity_line_item,\n has_overdue_task as has_overdue_task,\n id as id,\n is_closed as is_closed,\n is_deleted as is_deleted,\n is_won as is_won,\n last_activity_date as last_activity_date,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n lead_source as lead_source,\n name as name,\n next_step as next_step,\n owner_id as owner_id,\n probability as probability,\n record_type_id as record_type_id,\n stage_name as stage_name,\n synced_quote_id as synced_quote_id,\n type as type,\n cast(null as TEXT) as AccountId,\n cast(null as TEXT) as CampaignId,\n cast(null as timestamp) as CloseDate,\n cast(null as timestamp) as CreatedDate,\n cast(null as numeric(28,6)) as ExpectedRevenue,\n cast(null as integer) as FiscalQuarter,\n cast(null as integer) as FiscalYear,\n cast(null as TEXT) as ForecastCategory,\n cast(null as TEXT) as ForecastCategoryName,\n cast(null as boolean) as HasOpenActivity,\n cast(null as boolean) as HasOpportunityLineItem,\n cast(null as boolean) as HasOverdueTask,\n cast(null as boolean) as IsClosed,\n cast(null as boolean) as IsDeleted,\n cast(null as boolean) as IsWon,\n cast(null as timestamp) as LastActivityDate,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as LeadSource,\n cast(null as TEXT) as NextStep,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as RecordTypeId,\n cast(null as TEXT) as StageName,\n cast(null as TEXT) as SyncedQuoteId\n\n from \"postgres\".\"public\".\"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, "primary_key": ["opportunity_id"], "time_spine": null}, "model.salesforce.stg_salesforce__task": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__task", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__task.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__task.sql", "unique_id": "model.salesforce.stg_salesforce__task", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__task"], "alias": "stg_salesforce__task", "checksum": {"name": "sha256", "checksum": "64149d896796d839536af849f48d1c4384413ba689aba140534104e6f73de37e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "task_description": {"name": "task_description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0271223, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", task_dict, alias=\"task_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_disposition\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_duration_in_seconds\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_object\", task_dict) }},\n {{ salesforce.coalesce_rename(\"call_type\", task_dict) }},\n {{ salesforce.coalesce_rename(\"completed_date_time\", task_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"description\", task_dict, alias=\"task_description\") }},\n {{ salesforce.coalesce_rename(\"is_archived\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_closed\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", task_dict) }},\n {{ salesforce.coalesce_rename(\"is_high_priority\", task_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", task_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"priority\", task_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"status\", task_dict) }},\n {{ salesforce.coalesce_rename(\"subject\", task_dict) }},\n {{ salesforce.coalesce_rename(\"task_subtype\", task_dict) }},\n {{ salesforce.coalesce_rename(\"type\", task_dict) }},\n {{ salesforce.coalesce_rename(\"what_count\", task_dict) }},\n {{ salesforce.coalesce_rename(\"what_id\", task_dict) }},\n {{ salesforce.coalesce_rename(\"who_count\", task_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "task"], ["salesforce", "task"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_task_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_id as account_id,\n activity_date as activity_date,\n call_disposition as call_disposition,\n call_duration_in_seconds as call_duration_in_seconds,\n call_object as call_object,\n call_type as call_type,\n completed_date_time as completed_date_time,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n id as id,\n is_archived as is_archived,\n is_closed as is_closed,\n is_deleted as is_deleted,\n is_high_priority as is_high_priority,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n owner_id as owner_id,\n priority as priority,\n record_type_id as record_type_id,\n status as status,\n subject as subject,\n task_subtype as task_subtype,\n type as type,\n what_count as what_count,\n what_id as what_id,\n who_count as who_count,\n who_id as who_id,\n cast(null as TEXT) as AccountId,\n cast(null as timestamp) as ActivityDate,\n cast(null as TEXT) as CallDisposition,\n cast(null as integer) as CallDurationInSeconds,\n cast(null as TEXT) as CallObject,\n cast(null as TEXT) as CallType,\n cast(null as timestamp) as CompletedDateTime,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as boolean) as IsArchived,\n cast(null as boolean) as IsClosed,\n cast(null as boolean) as IsDeleted,\n cast(null as boolean) as IsHighPriority,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as RecordTypeId,\n cast(null as TEXT) as TaskSubtype,\n cast(null as integer) as WhatCount,\n cast(null as TEXT) as WhatId,\n cast(null as integer) as WhoCount,\n cast(null as TEXT) as WhoId\n \n from \"postgres\".\"public\".\"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, "primary_key": ["task_id"], "time_spine": null}, "model.salesforce.stg_salesforce__contact": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__contact.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__contact.sql", "unique_id": "model.salesforce.stg_salesforce__contact", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__contact"], "alias": "stg_salesforce__contact", "checksum": {"name": "sha256", "checksum": "21841381164da22dc571072c885ff93baa22e833cf12569a48e02ce62504d211"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0111191, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", contact_dict, alias=\"contact_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"department\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"description\", contact_dict, alias=\"contact_description\") }},\n {{ salesforce.coalesce_rename(\"email\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"first_name\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"home_phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"individual_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_name\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"lead_source\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_city\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_country\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_country_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_postal_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_state\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_state_code\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mailing_street\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"mobile_phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"name\", contact_dict, alias=\"contact_name\") }},\n {{ salesforce.coalesce_rename(\"owner_id\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"phone\", contact_dict) }},\n {{ salesforce.coalesce_rename(\"reports_to_id\", contact_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "contact"], ["salesforce", "contact"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_contact_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__contact.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_id as account_id,\n department as department,\n description as description,\n email as email,\n first_name as first_name,\n home_phone as home_phone,\n id as id,\n individual_id as individual_id,\n is_deleted as is_deleted,\n last_activity_date as last_activity_date,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n last_name as last_name,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n lead_source as lead_source,\n mailing_city as mailing_city,\n mailing_country as mailing_country,\n mailing_country_code as mailing_country_code,\n mailing_postal_code as mailing_postal_code,\n mailing_state as mailing_state,\n mailing_state_code as mailing_state_code,\n mailing_street as mailing_street,\n master_record_id as master_record_id,\n mobile_phone as mobile_phone,\n name as name,\n owner_id as owner_id,\n phone as phone,\n reports_to_id as reports_to_id,\n title as title,\n cast(null as TEXT) as AccountId,\n cast(null as TEXT) as FirstName,\n cast(null as TEXT) as HomePhone,\n cast(null as TEXT) as IndividualId,\n cast(null as boolean) as IsDeleted,\n cast(null as timestamp) as LastActivityDate,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as TEXT) as LastName,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as LeadSource,\n cast(null as TEXT) as MailingCity,\n cast(null as TEXT) as MailingCountry,\n cast(null as TEXT) as MailingCountryCode,\n cast(null as TEXT) as MailingPostalCode,\n cast(null as TEXT) as MailingState,\n cast(null as TEXT) as MailingStateCode,\n cast(null as TEXT) as MailingStreet,\n cast(null as TEXT) as MasterRecordId,\n cast(null as TEXT) as MobilePhone,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as ReportsToId\n \n from \"postgres\".\"public\".\"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, "primary_key": ["contact_id"], "time_spine": null}, "model.salesforce.stg_salesforce__campaign_member": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__campaign_member", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__campaign_member.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__campaign_member.sql", "unique_id": "model.salesforce.stg_salesforce__campaign_member", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__campaign_member"], "alias": "stg_salesforce__campaign_member", "checksum": {"name": "sha256", "checksum": "aed55b0c88e2e6fdbc064dbcefeb9d2ef0e63f6302d2da6acfc79c85bc226d87"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "Represents the relationship between a campaign and either a lead or a contact.", "columns": {"campaign_member_id": {"name": "campaign_member_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with the contact or lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "ID of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "contact_id": {"name": "contact_id", "description": "ID of the contact associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "ID of the user who created the campaign member record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the campaign member record was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_responded_date": {"name": "first_responded_date", "description": "Date when the contact or lead first responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the contact or lead has opted out of email communications.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "has_responded": {"name": "has_responded", "description": "Indicates whether the contact or lead has responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "ID of the user who last modified the campaign member record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_id": {"name": "lead_id", "description": "ID of the lead associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_or_contact_id": {"name": "lead_or_contact_id", "description": "ID of the lead or contact associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_or_contact_owner_id": {"name": "lead_or_contact_owner_id", "description": "ID of the owner of the lead or contact associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "The status of the campaign member, such as Sent or Responded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0307362, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign_member\"", "raw_code": "--To disable this model, set the salesforce__campaign_member_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__campaign_member_enabled', True)) }}\n\n{% set campaign_member_column_list = get_campaign_member_columns() -%}\n{% set campaign_member_dict = column_list_to_dict(campaign_member_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','campaign_member')),\n staging_columns=campaign_member_column_list\n )\n }}\n\n from {{ source('salesforce','campaign_member') }}\n),\n\nfinal as (\n\n select\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce.coalesce_rename(\"id\", campaign_member_dict, alias=\"campaign_member_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"campaign_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"contact_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"first_responded_date\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"has_opted_out_of_email\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"has_responded\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"lead_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"lead_or_contact_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"lead_or_contact_owner_id\", campaign_member_dict) }},\n {{ salesforce.coalesce_rename(\"status\", campaign_member_dict) }}\n\n {{ fivetran_utils.fill_pass_through_columns('salesforce__campaign_member_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "campaign_member"], ["salesforce", "campaign_member"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_campaign_member_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.campaign_member"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__campaign_member.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__campaign_member_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n\n \n _fivetran_active as _fivetran_active,\n _fivetran_synced as _fivetran_synced,\n account_id as account_id,\n campaign_id as campaign_id,\n contact_id as contact_id,\n created_by_id as created_by_id,\n created_date as created_date,\n first_responded_date as first_responded_date,\n has_opted_out_of_email as has_opted_out_of_email,\n has_responded as has_responded,\n id as id,\n is_deleted as is_deleted,\n last_modified_by_id as last_modified_by_id,\n lead_id as lead_id,\n lead_or_contact_id as lead_or_contact_id,\n lead_or_contact_owner_id as lead_or_contact_owner_id,\n status as status,\n cast(null as TEXT) as AccountId,\n cast(null as TEXT) as CampaignId,\n cast(null as TEXT) as ContactId,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as timestamp) as FirstRespondedDate,\n cast(null as boolean) as HasOptedOutOfEmail,\n cast(null as boolean) as HasResponded,\n cast(null as boolean) as IsDeleted,\n cast(null as TEXT) as LastModifiedById,\n cast(null as TEXT) as LeadId,\n cast(null as TEXT) as LeadOrContactId,\n cast(null as TEXT) as LeadOrContactOwnerId\n\n from \"postgres\".\"public\".\"sf_campaign_member_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 campaign_member_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(CampaignId as TEXT),\n cast(campaign_id as TEXT))\n as campaign_id,\n \n\n\n coalesce(cast(ContactId as TEXT),\n cast(contact_id as TEXT))\n as contact_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 coalesce(cast(FirstRespondedDate as timestamp),\n cast(first_responded_date as timestamp))\n as first_responded_date,\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(HasResponded as boolean),\n cast(has_responded as boolean))\n as has_responded,\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(LeadId as TEXT),\n cast(lead_id as TEXT))\n as lead_id,\n \n\n\n coalesce(cast(LeadOrContactId as TEXT),\n cast(lead_or_contact_id as TEXT))\n as lead_or_contact_id,\n \n\n\n coalesce(cast(LeadOrContactOwnerId as TEXT),\n cast(lead_or_contact_owner_id as TEXT))\n as lead_or_contact_owner_id,\n \n\n\n cast(Status as TEXT) as status\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, "primary_key": ["campaign_member_id"], "time_spine": null}, "model.salesforce.stg_salesforce__event": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__event", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__event.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__event.sql", "unique_id": "model.salesforce.stg_salesforce__event", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__event"], "alias": "stg_salesforce__event", "checksum": {"name": "sha256", "checksum": "52571ab849bf3ab43cc864b4d3ad1e6d83869770657712b88baa89be4d763b62"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "event_description": {"name": "event_description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0137308, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", event_dict, alias=\"event_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"activity_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"description\", event_dict, alias=\"event_description\") }},\n {{ salesforce.coalesce_rename(\"end_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"end_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"event_subtype\", event_dict) }},\n {{ salesforce.coalesce_rename(\"group_event_type\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_archived\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_child\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_group_event\", event_dict) }},\n {{ salesforce.coalesce_rename(\"is_recurrence\", event_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", event_dict) }},\n {{ salesforce.coalesce_rename(\"location\", event_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"start_date_time\", event_dict) }},\n {{ salesforce.coalesce_rename(\"subject\", event_dict) }},\n {{ salesforce.coalesce_rename(\"type\", event_dict) }},\n {{ salesforce.coalesce_rename(\"what_count\", event_dict) }},\n {{ salesforce.coalesce_rename(\"what_id\", event_dict) }},\n {{ salesforce.coalesce_rename(\"who_count\", event_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "event"], ["salesforce", "event"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_event_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_id as account_id,\n activity_date as activity_date,\n activity_date_time as activity_date_time,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n end_date as end_date,\n end_date_time as end_date_time,\n event_subtype as event_subtype,\n group_event_type as group_event_type,\n id as id,\n is_archived as is_archived,\n is_child as is_child,\n is_deleted as is_deleted,\n is_group_event as is_group_event,\n is_recurrence as is_recurrence,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n location as location,\n owner_id as owner_id,\n start_date_time as start_date_time,\n subject as subject,\n type as type,\n what_count as what_count,\n what_id as what_id,\n who_count as who_count,\n who_id as who_id,\n cast(null as TEXT) as AccountId,\n cast(null as timestamp) as ActivityDate,\n cast(null as timestamp) as ActivityDateTime,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as timestamp) as EndDate,\n cast(null as timestamp) as EndDateTime,\n cast(null as TEXT) as EventSubtype,\n cast(null as TEXT) as GroupEventType,\n cast(null as boolean) as IsArchived,\n cast(null as boolean) as IsChild,\n cast(null as boolean) as IsDeleted,\n cast(null as boolean) as IsGroupEvent,\n cast(null as boolean) as IsRecurrence,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as TEXT) as OwnerId,\n cast(null as timestamp) as StartDateTime,\n cast(null as integer) as WhatCount,\n cast(null as TEXT) as WhatId,\n cast(null as integer) as WhoCount,\n cast(null as TEXT) as WhoId\n\n from \"postgres\".\"public\".\"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, "primary_key": ["event_id"], "time_spine": null}, "model.salesforce.stg_salesforce__record_type": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__record_type", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__record_type.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__record_type.sql", "unique_id": "model.salesforce.stg_salesforce__record_type", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__record_type"], "alias": "stg_salesforce__record_type", "checksum": {"name": "sha256", "checksum": "6600ef83337c58feb0fa067423f21fd78e8cb5613144780b3601746196fefd8b"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "Represents a record type, which lets you offer different business processes, picklist values, and page layouts to different users.", "columns": {"record_type_id": {"name": "record_type_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record type is available for use.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "namespace_prefix": {"name": "namespace_prefix", "description": "The namespace prefix associated with this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_description": {"name": "record_type_description", "description": "Description of the record type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_name": {"name": "record_type_name", "description": "Label for this record type visible to users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "sobject_type": {"name": "sobject_type", "description": "The Salesforce object that this record type applies to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0324986, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"stg_salesforce__record_type\"", "raw_code": "--To disable this model, set the salesforce__record_type_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__record_type_enabled', True)) }}\n\n{% set record_type_column_list = get_record_type_columns() -%}\n{% set record_type_dict = column_list_to_dict(record_type_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','record_type')),\n staging_columns=record_type_column_list\n )\n }}\n\n from {{ source('salesforce','record_type') }}\n),\n\nfinal as (\n\n select\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce.coalesce_rename(\"id\", record_type_dict, alias=\"record_type_id\") }},\n {{ salesforce.coalesce_rename(\"description\", record_type_dict, alias=\"record_type_description\") }},\n {{ salesforce.coalesce_rename(\"developer_name\", record_type_dict) }},\n {{ salesforce.coalesce_rename(\"is_active\", record_type_dict) }},\n {{ salesforce.coalesce_rename(\"name\", record_type_dict, alias=\"record_type_name\") }},\n {{ salesforce.coalesce_rename(\"namespace_prefix\", record_type_dict) }},\n {{ salesforce.coalesce_rename(\"sobject_type\", record_type_dict) }}\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "record_type"], ["salesforce", "record_type"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_record_type_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename"], "nodes": ["source.salesforce.salesforce.record_type"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__record_type.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__record_type_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n\n \n _fivetran_deleted as _fivetran_deleted,\n _fivetran_synced as _fivetran_synced,\n description as description,\n developer_name as developer_name,\n id as id,\n is_active as is_active,\n name as name,\n namespace_prefix as namespace_prefix,\n sobject_type as sobject_type,\n cast(null as TEXT) as DeveloperName,\n cast(null as boolean) as IsActive,\n cast(null as TEXT) as NamespacePrefix,\n cast(null as TEXT) as SobjectType\n\n from \"postgres\".\"public\".\"sf_record_type_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 record_type_id,\n \n\n\n cast(Description as TEXT) as record_type_description,\n \n\n\n coalesce(cast(DeveloperName as TEXT),\n cast(developer_name as TEXT))\n as developer_name,\n \n\n\n coalesce(cast(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n cast(Name as TEXT) as record_type_name,\n \n\n\n coalesce(cast(NamespacePrefix as TEXT),\n cast(namespace_prefix as TEXT))\n as namespace_prefix,\n \n\n\n coalesce(cast(SobjectType as TEXT),\n cast(sobject_type as TEXT))\n as sobject_type\n\n from fields\n where not coalesce(_fivetran_deleted, false)\n)\n\nselect *\nfrom final", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "access": "protected", "constraints": [], "version": null, "latest_version": null, "deprecation_date": null, "primary_key": ["record_type_id"], "time_spine": null}, "model.salesforce.stg_salesforce__campaign": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__campaign", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__campaign.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__campaign.sql", "unique_id": "model.salesforce.stg_salesforce__campaign", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__campaign"], "alias": "stg_salesforce__campaign", "checksum": {"name": "sha256", "checksum": "1c4bfaeb5e395756f3abe52c00521e88a5b22a4f3e0d2e091fd1704d86df0c2f"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "Represents a marketing campaign, such as a direct mail promotion, webinar, or trade show.", "columns": {"campaign_id": {"name": "campaign_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "actual_cost": {"name": "actual_cost", "description": "Amount of money spent to run the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "budgeted_cost": {"name": "budgeted_cost", "description": "Amount of money budgeted for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_description": {"name": "campaign_description", "description": "Description of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "Required. Name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_status": {"name": "campaign_status", "description": "Status of the campaign, such as Planned, In Progress, or Completed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "Type of campaign, such as Direct Mail, Email, or Webinar.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Ending date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether the campaign is active (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_contacts": {"name": "number_of_contacts", "description": "Number of contacts associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_converted_leads": {"name": "number_of_converted_leads", "description": "Number of leads associated with the campaign that have been converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_leads": {"name": "number_of_leads", "description": "Number of leads associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_opportunities": {"name": "number_of_opportunities", "description": "Number of opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_responses": {"name": "number_of_responses", "description": "Number of contacts and leads that have a campaign member status where the Has Responded field is true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_won_opportunities": {"name": "number_of_won_opportunities", "description": "Number of opportunities associated with the campaign that have a probability of 100% because they are closed and won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_record_type_id": {"name": "campaign_member_record_type_id", "description": "ID of the record type assigned to campaign members of this campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_campaign_id": {"name": "parent_campaign_id", "description": "The ID of the parent campaign, if applicable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "start_date": {"name": "start_date", "description": "Starting date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "Total amount of all opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0290742, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign\"", "raw_code": "--To disable this model, set the salesforce__campaign_enabled within your dbt_project.yml file to False.\n{{ config(enabled=var('salesforce__campaign_enabled', True)) }}\n\n{% set campaign_column_list = get_campaign_columns() -%}\n{% set campaign_dict = column_list_to_dict(campaign_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','campaign')),\n staging_columns=campaign_column_list\n )\n }}\n\n from {{ source('salesforce','campaign') }}\n),\n\nfinal as (\n\n select\n cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced,\n {{ salesforce.coalesce_rename(\"id\", campaign_dict, alias=\"campaign_id\") }},\n {{ salesforce.coalesce_rename(\"actual_cost\", campaign_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"amount_all_opportunities\", campaign_dict, alias=\"total_pipeline_amount\", datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"budgeted_cost\", campaign_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"campaign_member_record_type_id\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"description\", campaign_dict, alias=\"campaign_description\") }},\n {{ salesforce.coalesce_rename(\"end_date\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"is_active\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"name\", campaign_dict, alias=\"campaign_name\") }},\n {{ salesforce.coalesce_rename(\"number_of_contacts\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_converted_leads\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_leads\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_opportunities\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_responses\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_won_opportunities\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"parent_id\", campaign_dict, alias=\"parent_campaign_id\") }},\n {{ salesforce.coalesce_rename(\"start_date\", campaign_dict) }},\n {{ salesforce.coalesce_rename(\"status\", campaign_dict, alias=\"campaign_status\") }},\n {{ salesforce.coalesce_rename(\"type\", campaign_dict, alias=\"campaign_type\") }}\n\n {{ fivetran_utils.fill_pass_through_columns('salesforce__campaign_pass_through_columns') }}\n\n from fields\n where coalesce(_fivetran_active, true)\n)\n\nselect *\nfrom final\nwhere not coalesce(is_deleted, false)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "campaign"], ["salesforce", "campaign"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_campaign_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.campaign"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__campaign.sql", "compiled": true, "compiled_code": "--To disable this model, set the salesforce__campaign_enabled within your dbt_project.yml file to False.\n\n\nwith fields as (\n\n select\n\n \n _fivetran_active as _fivetran_active,\n _fivetran_synced as _fivetran_synced,\n actual_cost as actual_cost,\n amount_all_opportunities as amount_all_opportunities,\n budgeted_cost as budgeted_cost,\n description as description,\n end_date as end_date,\n id as id,\n is_active as is_active,\n is_deleted as is_deleted,\n name as name,\n number_of_contacts as number_of_contacts,\n number_of_converted_leads as number_of_converted_leads,\n number_of_leads as number_of_leads,\n number_of_opportunities as number_of_opportunities,\n number_of_responses as number_of_responses,\n number_of_won_opportunities as number_of_won_opportunities,\n campaign_member_record_type_id as campaign_member_record_type_id,\n parent_id as parent_id,\n start_date as start_date,\n status as status,\n type as type,\n cast(null as numeric(28,6)) as ActualCost,\n cast(null as numeric(28,6)) as AmountAllOpportunities,\n cast(null as numeric(28,6)) as BudgetedCost,\n cast(null as timestamp) as EndDate,\n cast(null as boolean) as IsActive,\n cast(null as boolean) as IsDeleted,\n cast(null as integer) as NumberOfContacts,\n cast(null as integer) as NumberOfConvertedLeads,\n cast(null as integer) as NumberOfLeads,\n cast(null as integer) as NumberOfOpportunities,\n cast(null as integer) as NumberOfResponses,\n cast(null as integer) as NumberOfWonOpportunities,\n cast(null as TEXT) as CampaignMemberRecordTypeId,\n cast(null as TEXT) as ParentId,\n cast(null as timestamp) as StartDate\n\n from \"postgres\".\"public\".\"sf_campaign_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 campaign_id,\n \n\n\n coalesce(cast(ActualCost as numeric(28,6)),\n cast(actual_cost as numeric(28,6)))\n as actual_cost,\n \n\n\n coalesce(cast(AmountAllOpportunities as numeric(28,6)),\n cast(amount_all_opportunities as numeric(28,6)))\n as total_pipeline_amount,\n \n\n\n coalesce(cast(BudgetedCost as numeric(28,6)),\n cast(budgeted_cost as numeric(28,6)))\n as budgeted_cost,\n \n\n\n coalesce(cast(CampaignMemberRecordTypeId as TEXT),\n cast(campaign_member_record_type_id as TEXT))\n as campaign_member_record_type_id,\n \n\n\n cast(Description as TEXT) as campaign_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(IsActive as boolean),\n cast(is_active as boolean))\n as is_active,\n \n\n\n coalesce(cast(IsDeleted as boolean),\n cast(is_deleted as boolean))\n as is_deleted,\n \n\n\n cast(Name as TEXT) as campaign_name,\n \n\n\n coalesce(cast(NumberOfContacts as integer),\n cast(number_of_contacts as integer))\n as number_of_contacts,\n \n\n\n coalesce(cast(NumberOfConvertedLeads as integer),\n cast(number_of_converted_leads as integer))\n as number_of_converted_leads,\n \n\n\n coalesce(cast(NumberOfLeads as integer),\n cast(number_of_leads as integer))\n as number_of_leads,\n \n\n\n coalesce(cast(NumberOfOpportunities as integer),\n cast(number_of_opportunities as integer))\n as number_of_opportunities,\n \n\n\n coalesce(cast(NumberOfResponses as integer),\n cast(number_of_responses as integer))\n as number_of_responses,\n \n\n\n coalesce(cast(NumberOfWonOpportunities as integer),\n cast(number_of_won_opportunities as integer))\n as number_of_won_opportunities,\n \n\n\n coalesce(cast(ParentId as TEXT),\n cast(parent_id as TEXT))\n as parent_campaign_id,\n \n\n\n coalesce(cast(StartDate as timestamp),\n cast(start_date as timestamp))\n as start_date,\n \n\n\n cast(Status as TEXT) as campaign_status,\n \n\n\n cast(Type as TEXT) as campaign_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, "primary_key": ["campaign_id"], "time_spine": null}, "model.salesforce.stg_salesforce__user_role": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__user_role", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__user_role.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__user_role.sql", "unique_id": "model.salesforce.stg_salesforce__user_role", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__user_role"], "alias": "stg_salesforce__user_role", "checksum": {"name": "sha256", "checksum": "150992d1cc9b40b7ddf27f58e103906b245c333d84b9b004ea347e0ccadd65b0"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0090637, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"developer_name\", user_role_dict ) }},\n {{ salesforce.coalesce_rename(\"id\", user_role_dict, alias=\"user_role_id\") }},\n {{ salesforce.coalesce_rename(\"name\", user_role_dict, alias=\"user_role_name\") }},\n {{ salesforce.coalesce_rename(\"opportunity_access_for_account_owner\", user_role_dict ) }},\n {{ salesforce.coalesce_rename(\"parent_role_id\", user_role_dict ) }},\n {{ salesforce.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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "user_role"], ["salesforce", "user_role"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_user_role_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_deleted as _fivetran_deleted,\n _fivetran_active as _fivetran_active,\n _fivetran_synced as _fivetran_synced,\n developer_name as developer_name,\n id as id,\n name as name,\n opportunity_access_for_account_owner as opportunity_access_for_account_owner,\n parent_role_id as parent_role_id,\n rollup_description as rollup_description,\n cast(null as TEXT) as DeveloperName,\n cast(null as TEXT) as OpportunityAccessForAccountOwner,\n cast(null as TEXT) as ParentRoleId,\n cast(null as TEXT) as RollupDescription\n\n from \"postgres\".\"public\".\"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, "primary_key": ["user_role_id"], "time_spine": null}, "model.salesforce.stg_salesforce__order": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__order", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__order.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__order.sql", "unique_id": "model.salesforce.stg_salesforce__order", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__order"], "alias": "stg_salesforce__order", "checksum": {"name": "sha256", "checksum": "e4fe18c208b953d2f6e96f9e073c7ce222339b68db76c34e232d68ebf8a9836e"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "order_description": {"name": "order_description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0223198, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", order_dict, alias=\"order_id\") }},\n {{ salesforce.coalesce_rename(\"account_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"activated_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"activated_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_city\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_postal_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"billing_street\", order_dict) }},\n {{ salesforce.coalesce_rename(\"contract_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"created_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"description\", order_dict, alias=\"order_description\") }},\n {{ salesforce.coalesce_rename(\"end_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", order_dict) }},\n {{ salesforce.coalesce_rename(\"opportunity_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"order_number\", order_dict) }},\n {{ salesforce.coalesce_rename(\"original_order_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"pricebook_2_id\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_city\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_postal_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state_code\", order_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_street\", order_dict) }},\n {{ salesforce.coalesce_rename(\"status\", order_dict) }},\n {{ salesforce.coalesce_rename(\"total_amount\", order_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "order"], ["salesforce", "order"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_order_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_id as account_id,\n activated_by_id as activated_by_id,\n activated_date as activated_date,\n billing_city as billing_city,\n billing_country as billing_country,\n billing_country_code as billing_country_code,\n billing_postal_code as billing_postal_code,\n billing_state as billing_state,\n billing_state_code as billing_state_code,\n billing_street as billing_street,\n contract_id as contract_id,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n end_date as end_date,\n id as id,\n is_deleted as is_deleted,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n opportunity_id as opportunity_id,\n order_number as order_number,\n original_order_id as original_order_id,\n owner_id as owner_id,\n pricebook_2_id as pricebook_2_id,\n shipping_city as shipping_city,\n shipping_country as shipping_country,\n shipping_country_code as shipping_country_code,\n shipping_postal_code as shipping_postal_code,\n shipping_state as shipping_state,\n shipping_state_code as shipping_state_code,\n shipping_street as shipping_street,\n status as status,\n total_amount as total_amount,\n type as type,\n cast(null as TEXT) as AccountId,\n cast(null as TEXT) as ActivatedById,\n cast(null as timestamp) as ActivatedDate,\n cast(null as TEXT) as BillingCity,\n cast(null as TEXT) as BillingCountry,\n cast(null as TEXT) as BillingCountryCode,\n cast(null as TEXT) as BillingPostalCode,\n cast(null as TEXT) as BillingState,\n cast(null as TEXT) as BillingStateCode,\n cast(null as TEXT) as BillingStreet,\n cast(null as TEXT) as ContractId,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as timestamp) as EndDate,\n cast(null as boolean) as IsDeleted,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as OpportunityId,\n cast(null as TEXT) as OrderNumber,\n cast(null as TEXT) as OriginalOrderId,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as Pricebook2Id,\n cast(null as TEXT) as ShippingCity,\n cast(null as TEXT) as ShippingCountry,\n cast(null as TEXT) as ShippingCountryCode,\n cast(null as TEXT) as ShippingPostalCode,\n cast(null as TEXT) as ShippingState,\n cast(null as TEXT) as ShippingStateCode,\n cast(null as TEXT) as ShippingStreet,\n cast(null as float) as TotalAmount\n \n from \"postgres\".\"public\".\"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, "primary_key": ["order_id"], "time_spine": null}, "model.salesforce.stg_salesforce__product_2": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__product_2", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__product_2.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__product_2.sql", "unique_id": "model.salesforce.stg_salesforce__product_2", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__product_2"], "alias": "stg_salesforce__product_2", "checksum": {"name": "sha256", "checksum": "14555f471e20bb0d9dbde8776a0083f91b52069368ac42c03989c95568b50084"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.024325, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", product_2_dict, alias=\"product_2_id\") }},\n {{ salesforce.coalesce_rename(\"created_by_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"description\", product_2_dict, alias=\"product_2_description\") }},\n {{ salesforce.coalesce_rename(\"display_url\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"external_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"family\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_active\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_archived\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"name\", product_2_dict, alias=\"product_2_name\") }},\n {{ salesforce.coalesce_rename(\"number_of_quantity_installments\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"number_of_revenue_installments\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"product_code\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_installment_period\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_schedule_type\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"quantity_unit_of_measure\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", product_2_dict) }},\n {{ salesforce.coalesce_rename(\"revenue_installment_period\", product_2_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "product_2"], ["salesforce", "product_2"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_product_2_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n display_url as display_url,\n external_id as external_id,\n family as family,\n id as id,\n is_active as is_active,\n is_archived as is_archived,\n is_deleted as is_deleted,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n name as name,\n number_of_quantity_installments as number_of_quantity_installments,\n number_of_revenue_installments as number_of_revenue_installments,\n product_code as product_code,\n quantity_installment_period as quantity_installment_period,\n quantity_schedule_type as quantity_schedule_type,\n quantity_unit_of_measure as quantity_unit_of_measure,\n record_type_id as record_type_id,\n revenue_installment_period as revenue_installment_period,\n revenue_schedule_type as revenue_schedule_type,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as TEXT) as DisplayUrl,\n cast(null as TEXT) as ExternalId,\n cast(null as boolean) as IsActive,\n cast(null as boolean) as IsArchived,\n cast(null as boolean) as IsDeleted,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as integer) as NumberOfQuantityInstallments,\n cast(null as integer) as NumberOfRevenueInstallments,\n cast(null as TEXT) as ProductCode,\n cast(null as TEXT) as QuantityInstallmentPeriod,\n cast(null as TEXT) as QuantityScheduleType,\n cast(null as TEXT) as QuantityUnitOfMeasure,\n cast(null as TEXT) as RecordTypeId,\n cast(null as TEXT) as RevenueInstallmentPeriod,\n cast(null as TEXT) as RevenueScheduleType\n \n from \"postgres\".\"public\".\"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, "primary_key": ["product_2_id"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity_line_item": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_line_item", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__opportunity_line_item.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__opportunity_line_item.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity_line_item", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__opportunity_line_item"], "alias": "stg_salesforce__opportunity_line_item", "checksum": {"name": "sha256", "checksum": "0d0c63bb3f3eba994cef70b9d069fc7a0a8e27b9a34650395f4a16ac0248e585"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_line_item_description": {"name": "opportunity_line_item_description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "enabled": true, "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0191634, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"id\", opportunity_line_item_dict, alias=\"opportunity_line_item_id\") }},\n {{ salesforce.coalesce_rename(\"created_by_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"created_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"description\", opportunity_line_item_dict, alias=\"opportunity_line_item_description\") }},\n {{ salesforce.coalesce_rename(\"discount\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_quantity_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_revenue_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"has_schedule\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_by_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_modified_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"list_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"name\", opportunity_line_item_dict, alias=\"opportunity_line_item_name\") }},\n {{ salesforce.coalesce_rename(\"opportunity_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"pricebook_entry_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"product_2_id\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"product_code\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"quantity\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"service_date\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"sort_order\", opportunity_line_item_dict) }},\n {{ salesforce.coalesce_rename(\"total_price\", opportunity_line_item_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "opportunity_line_item"], ["salesforce", "opportunity_line_item"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_opportunity_line_item_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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 _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n created_by_id as created_by_id,\n created_date as created_date,\n description as description,\n discount as discount,\n has_quantity_schedule as has_quantity_schedule,\n has_revenue_schedule as has_revenue_schedule,\n has_schedule as has_schedule,\n id as id,\n is_deleted as is_deleted,\n last_modified_by_id as last_modified_by_id,\n last_modified_date as last_modified_date,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n list_price as list_price,\n name as name,\n opportunity_id as opportunity_id,\n pricebook_entry_id as pricebook_entry_id,\n product_2_id as product_2_id,\n product_code as product_code,\n quantity as quantity,\n service_date as service_date,\n sort_order as sort_order,\n total_price as total_price,\n unit_price as unit_price,\n cast(null as TEXT) as CreatedById,\n cast(null as timestamp) as CreatedDate,\n cast(null as boolean) as HasQuantitySchedule,\n cast(null as boolean) as HasRevenueSchedule,\n cast(null as boolean) as HasSchedule,\n cast(null as boolean) as IsDeleted,\n cast(null as TEXT) as LastModifiedById,\n cast(null as timestamp) as LastModifiedDate,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as float) as ListPrice,\n cast(null as TEXT) as OpportunityId,\n cast(null as TEXT) as PricebookEntryId,\n cast(null as TEXT) as Product2Id,\n cast(null as TEXT) as ProductCode,\n cast(null as timestamp) as ServiceDate,\n cast(null as integer) as SortOrder,\n cast(null as float) as TotalPrice,\n cast(null as float) as UnitPrice\n \n from \"postgres\".\"public\".\"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, "primary_key": ["opportunity_line_item_id"], "time_spine": null}, "model.salesforce.stg_salesforce__account": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__account", "resource_type": "model", "package_name": "salesforce", "path": "salesforce/staging/stg_salesforce__account.sql", "original_file_path": "models/salesforce/staging/stg_salesforce__account.sql", "unique_id": "model.salesforce.stg_salesforce__account", "fqn": ["salesforce", "salesforce", "staging", "stg_salesforce__account"], "alias": "stg_salesforce__account", "checksum": {"name": "sha256", "checksum": "393969eb0d34ff6508eb1002cebc19f23400a833e15b07c85e703ac1271a96d0"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce/staging/stg_salesforce.yml", "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.0002947, "relation_name": "\"postgres\".\"public_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.coalesce_rename(\"account_number\", account_dict) }},\n {{ salesforce.coalesce_rename(\"account_source\", account_dict) }},\n {{ salesforce.coalesce_rename(\"annual_revenue\", account_dict, datatype=dbt.type_numeric()) }},\n {{ salesforce.coalesce_rename(\"billing_city\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_country\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_postal_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_state_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"billing_street\", account_dict) }},\n {{ salesforce.coalesce_rename(\"description\", account_dict, alias=\"account_description\" ) }},\n {{ salesforce.coalesce_rename(\"id\", account_dict, alias=\"account_id\") }},\n {{ salesforce.coalesce_rename(\"industry\", account_dict) }},\n {{ salesforce.coalesce_rename(\"is_deleted\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_activity_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_referenced_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"last_viewed_date\", account_dict) }},\n {{ salesforce.coalesce_rename(\"master_record_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"name\", account_dict, alias=\"account_name\" ) }},\n {{ salesforce.coalesce_rename(\"number_of_employees\", account_dict) }},\n {{ salesforce.coalesce_rename(\"owner_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"ownership\", account_dict) }},\n {{ salesforce.coalesce_rename(\"parent_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"rating\", account_dict) }},\n {{ salesforce.coalesce_rename(\"record_type_id\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_city\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_country_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_postal_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_state_code\", account_dict) }},\n {{ salesforce.coalesce_rename(\"shipping_street\", account_dict) }},\n {{ salesforce.coalesce_rename(\"type\", account_dict) }},\n {{ salesforce.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)", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce", "account"], ["salesforce", "account"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.salesforce.get_account_columns", "macro.salesforce.column_list_to_dict", "macro.fivetran_utils.fill_staging_columns", "macro.dbt.type_timestamp", "macro.salesforce.coalesce_rename", "macro.dbt.type_numeric", "macro.fivetran_utils.fill_pass_through_columns"], "nodes": ["source.salesforce.salesforce.account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce__account.sql", "compiled": true, "compiled_code": "with fields as (\n\n select\n \n _fivetran_synced as _fivetran_synced,\n _fivetran_active as _fivetran_active,\n account_number as account_number,\n account_source as account_source,\n annual_revenue as annual_revenue,\n billing_city as billing_city,\n billing_country as billing_country,\n billing_postal_code as billing_postal_code,\n billing_state as billing_state,\n billing_state_code as billing_state_code,\n billing_street as billing_street,\n description as description,\n id as id,\n industry as industry,\n is_deleted as is_deleted,\n last_activity_date as last_activity_date,\n last_referenced_date as last_referenced_date,\n last_viewed_date as last_viewed_date,\n master_record_id as master_record_id,\n name as name,\n number_of_employees as number_of_employees,\n owner_id as owner_id,\n ownership as ownership,\n parent_id as parent_id,\n rating as rating,\n record_type_id as record_type_id,\n shipping_city as shipping_city,\n shipping_country as shipping_country,\n shipping_country_code as shipping_country_code,\n shipping_postal_code as shipping_postal_code,\n shipping_state as shipping_state,\n shipping_state_code as shipping_state_code,\n shipping_street as shipping_street,\n type as type,\n website as website,\n cast(null as TEXT) as AccountNumber,\n cast(null as TEXT) as AccountSource,\n cast(null as float) as AnnualRevenue,\n cast(null as TEXT) as BillingCity,\n cast(null as TEXT) as BillingCountry,\n cast(null as TEXT) as BillingPostalCode,\n cast(null as TEXT) as BillingState,\n cast(null as TEXT) as BillingStateCode,\n cast(null as TEXT) as BillingStreet,\n cast(null as boolean) as IsDeleted,\n cast(null as timestamp) as LastActivityDate,\n cast(null as timestamp) as LastReferencedDate,\n cast(null as timestamp) as LastViewedDate,\n cast(null as TEXT) as MasterRecordId,\n cast(null as integer) as NumberOfEmployees,\n cast(null as TEXT) as OwnerId,\n cast(null as TEXT) as ParentId,\n cast(null as TEXT) as RecordTypeId,\n cast(null as TEXT) as ShippingCity,\n cast(null as TEXT) as ShippingCountry,\n cast(null as TEXT) as ShippingCountryCode,\n cast(null as TEXT) as ShippingPostalCode,\n cast(null as TEXT) as ShippingState,\n cast(null as TEXT) as ShippingStateCode,\n cast(null as TEXT) as ShippingStreet\n\n from \"postgres\".\"public\".\"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, "primary_key": ["account_id"], "time_spine": null}, "model.salesforce.int_salesforce__date_spine": {"database": "postgres", "schema": "public_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": "9ad85ca49c9b477a4ef0b96713a25d452c176bac73d4d6124c27447f3f85f675"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.1894636, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"int_salesforce__date_spine\"", "raw_code": "{% if var('salesforce__lead_enabled', True) -%}\n-- depends_on: {{ ref('stg_salesforce__lead') }}\n{% else -%}\n-- depends_on: {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__lead') }}\n {% else %}\n from {{ ref('stg_salesforce__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 {{ ref('stg_salesforce__lead') }}\n {% else %}\n from {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/intermediate/int_salesforce__date_spine.sql", "compiled": true, "compiled_code": "-- depends_on: \"postgres\".\"public_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('2026-06-15' as date) + ((interval '1 day') * (row_number() over (order by generated_number) - 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('2026-07-15' 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, "primary_key": [], "time_spine": null}, "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": {"database": "postgres", "schema": "public_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": "7885ddda21df6369525863d32bf5663cd3d248779c42d338a37ecd7be042c232"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "table", "incremental_strategy": null, "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": null, "on_schema_change": "ignore", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null}, "tags": [], "description": "", "columns": {}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": null, "build_path": null, "unrendered_config": {"materialized": "table", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132716.2379274, "relation_name": "\"postgres\".\"public_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 {{ ref('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", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}, {"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.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\".\"public_salesforce_dev\".\"salesforce__opportunity_enhanced\"\n), \n\nsalesforce_user as (\n\n select * \n from \"postgres\".\"public_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, "primary_key": [], "time_spine": null}, "model.salesforce.salesforce__account_daily_history": {"database": "postgres", "schema": "public_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": "5cf94168294af56b93c6d3b41542f537e7c7209edd92427317244f78accc7639"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the account had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "account_day_id", "incremental_strategy": "delete+insert", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2065585, "relation_name": "\"postgres\".\"public_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 = 'delta',\n on_schema_change = 'fail'\n )\n}}\n\n{% set first_date = var('account_history_start_date', var('global_history_start_date', '2020-01-01')) %}\n\nwith spine as (\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date ~ \"' as date)\",\n end_date = \"cast(current_date as date)\"\n )\n }}\n),\n\naccount_history as (\n\n select * \n from {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp"], "nodes": ["model.salesforce.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__account_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith spine as (\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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2387\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 generated_number) - 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(current_date as date)\n\n)\n\nselect * from filtered\n\n\n),\n\naccount_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__account_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__account_daily_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, "primary_key": ["account_day_id"], "time_spine": null}, "model.salesforce.salesforce__contact_daily_history": {"database": "postgres", "schema": "public_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": "5cdb46d4aad2fbb2cf7390ae66d3b6c289175a42b3444cb3c9ddd3e02dfcc1a2"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "contact_id": {"name": "contact_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "contact_day_id", "incremental_strategy": "delete+insert", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2090569, "relation_name": "\"postgres\".\"public_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 = 'delta',\n on_schema_change = 'fail'\n )\n}}\n\n{% set first_date = var('contact_history_start_date', var('global_history_start_date', '2020-01-01')) %}\n\nwith spine as (\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date ~ \"' as date)\",\n end_date = \"cast(current_date as date)\"\n )\n }}\n),\n\ncontact_history as (\n\n select * \n from {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp"], "nodes": ["model.salesforce.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__contact_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith spine as (\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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2387\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 generated_number) - 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(current_date as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncontact_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__contact_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__contact_daily_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, "primary_key": ["contact_day_id"], "time_spine": null}, "model.salesforce.salesforce__campaign_daily_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "salesforce__campaign_daily_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/salesforce__campaign_daily_history.sql", "original_file_path": "models/salesforce_history/salesforce__campaign_daily_history.sql", "unique_id": "model.salesforce.salesforce__campaign_daily_history", "fqn": ["salesforce", "salesforce_history", "salesforce__campaign_daily_history"], "alias": "salesforce__campaign_daily_history", "checksum": {"name": "sha256", "checksum": "c6259d395c7c4249c41471568b0067da446476499ac1255d5a9e6b3c6c5a7891"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "campaign_day_id", "on_schema_change": "fail", "on_configuration_change": "apply", "grants": {}, "packages": [], "docs": {"show": true, "node_color": null}, "contract": {"enforced": false, "alias_types": true}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "tags": [], "description": "Each record is a daily snapshot of a campaign, starting with its first active date and updating up toward either the current date (if still active) or its last active date.", "columns": {"campaign_day_id": {"name": "campaign_day_id", "description": "Surrogate key hashed on `date_day` and `campaign_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the campaign had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `campaign_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "actual_cost": {"name": "actual_cost", "description": "Amount of money spent to run the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "total_pipeline_amount": {"name": "total_pipeline_amount", "description": "Total amount of all opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "budgeted_cost": {"name": "budgeted_cost", "description": "Amount of money budgeted for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_record_type_id": {"name": "campaign_member_record_type_id", "description": "ID of the record type assigned to campaign members of this campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_description": {"name": "campaign_description", "description": "Text description of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Ending date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether the campaign is active (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_name": {"name": "campaign_name", "description": "Name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_contacts": {"name": "number_of_contacts", "description": "Number of contacts associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_converted_leads": {"name": "number_of_converted_leads", "description": "Number of leads associated with the campaign that have been converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_leads": {"name": "number_of_leads", "description": "Number of leads associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_opportunities": {"name": "number_of_opportunities", "description": "Number of opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_responses": {"name": "number_of_responses", "description": "Number of contacts and leads that responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_won_opportunities": {"name": "number_of_won_opportunities", "description": "Number of closed-won opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_campaign_id": {"name": "parent_campaign_id", "description": "The ID of the parent campaign, if applicable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "start_date": {"name": "start_date", "description": "Starting date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_status": {"name": "campaign_status", "description": "Status of the campaign, such as Planned, In Progress, or Completed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_type": {"name": "campaign_type", "description": "Type of campaign, such as Direct Mail, Email, or Webinar.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "campaign_day_id", "incremental_strategy": "delete+insert", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.203932, "relation_name": "\"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_daily_history\"", "raw_code": "{{\n config(\n enabled = var('salesforce__campaign_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 = 'campaign_day_id',\n incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert',\n file_format = 'delta',\n on_schema_change = 'fail'\n )\n}}\n\n{% set first_date = var('campaign_history_start_date', var('global_history_start_date', '2020-01-01')) %}\n\nwith spine as (\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date ~ \"' as date)\",\n end_date = \"cast(current_date as date)\"\n )\n }}\n),\n\ncampaign_history as (\n\n select\n id as campaign_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 {{ dbt_utils.star(from=source('salesforce_history','campaign'),\n except=[\"id\", \"_fivetran_start\", \"_fivetran_end\"]) }}\n\n from {{ source('salesforce_history','campaign') }}\n\n {% if is_incremental() %}\n where cast(_fivetran_start as date) >= (select max(cast((_fivetran_start) as date)) from {{ this }})\n {% else %}\n where cast(_fivetran_start as date) >= cast('{{ first_date }}' as date)\n {% endif %}\n),\n\norder_daily_values as (\n\n select\n *,\n row_number() over (\n partition by _fivetran_date, campaign_id\n order by _fivetran_start desc) as row_num\n from campaign_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.campaign_id']) }} as campaign_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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "campaign"], ["salesforce_history", "campaign"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star", "macro.dbt.is_incremental"], "nodes": ["source.salesforce.salesforce_history.campaign"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce__campaign_daily_history.sql", "compiled": true, "compiled_code": "\n\n\n\nwith spine as (\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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2387\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 generated_number) - 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(current_date as date)\n\n)\n\nselect * from filtered\n\n\n),\n\ncampaign_history as (\n\n select\n id as campaign_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 \"_fivetran_active\",\n \"_fivetran_synced\",\n \"name\",\n \"type\",\n \"status\",\n \"start_date\",\n \"end_date\",\n \"is_active\",\n \"is_deleted\",\n \"parent_id\",\n \"budgeted_cost\",\n \"actual_cost\",\n \"number_of_leads\",\n \"number_of_converted_leads\",\n \"number_of_contacts\",\n \"number_of_responses\",\n \"number_of_opportunities\",\n \"number_of_won_opportunities\",\n \"amount_all_opportunities\",\n \"description\",\n \"campaign_member_record_type_id\"\n\n from \"postgres\".\"public\".\"sf_campaign_history_data\"\n\n \n where cast(_fivetran_start as date) >= (select max(cast((_fivetran_start) as date)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_daily_history\")\n \n),\n\norder_daily_values as (\n\n select\n *,\n row_number() over (\n partition by _fivetran_date, campaign_id\n order by _fivetran_start desc) as row_num\n from campaign_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.campaign_id as TEXT), '_dbt_utils_surrogate_key_null_') as TEXT)) as campaign_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, "primary_key": ["campaign_day_id"], "time_spine": null}, "model.salesforce.salesforce__opportunity_daily_history": {"database": "postgres", "schema": "public_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": "837ec46c427fa573c15839d955f65011c30be867ffc95b1851aed3a04d0085c2"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "date_day", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "date_day": {"name": "date_day", "description": "Date on which the opportunity had these field values.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/salesforce_history.yml", "build_path": null, "unrendered_config": {"materialized": "incremental", "enabled": true, "partition_by": {"field": "date_day", "data_type": "date"}, "unique_key": "opportunity_day_id", "incremental_strategy": "delete+insert", "file_format": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2116723, "relation_name": "\"postgres\".\"public_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 = 'delta',\n on_schema_change = 'fail'\n )\n}}\n\n\n{% set first_date = var('opportunity_history_start_date', var('global_history_start_date', '2020-01-01')) %}\n\nwith spine as (\n\n {{ dbt_utils.date_spine(\n datepart=\"day\",\n start_date = \"cast('\" ~ first_date ~ \"' as date)\",\n end_date = \"cast(current_date as date)\"\n )\n }}\n),\n\nopportunity_history as (\n\n select * \n from {{ ref('stg_salesforce__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", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt_utils.date_spine", "macro.dbt.is_incremental", "macro.dbt_utils.generate_surrogate_key", "macro.dbt.type_timestamp"], "nodes": ["model.salesforce.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\nwith spine as (\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 p11.generated_number * power(2, 11)\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 cross join \n \n p as p11\n \n \n\n )\n\n select *\n from unioned\n where generated_number <= 2387\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 generated_number) - 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(current_date as date)\n\n)\n\nselect * from filtered\n\n\n),\n\nopportunity_history as (\n\n select * \n from \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__opportunity_history\"\n \n where _fivetran_start >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"salesforce__opportunity_daily_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, "primary_key": ["opportunity_day_id"], "time_spine": null}, "model.salesforce.stg_salesforce__contact_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__contact_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__contact_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__contact_history.sql", "unique_id": "model.salesforce.stg_salesforce__contact_history", "fqn": ["salesforce", "salesforce_history", "staging", "stg_salesforce__contact_history"], "alias": "stg_salesforce__contact_history", "checksum": {"name": "sha256", "checksum": "7c3b7036ccae7adc3f36be2f709700385b6ae874fe4f58a89bbaab9d52194984"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `contact_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2520728, "relation_name": "\"postgres\".\"public_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='delta',\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "contact"], ["salesforce_history", "contact"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__contact_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_contact_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "model.salesforce.stg_salesforce__account_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__account_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__account_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__account_history.sql", "unique_id": "model.salesforce.stg_salesforce__account_history", "fqn": ["salesforce", "salesforce_history", "staging", "stg_salesforce__account_history"], "alias": "stg_salesforce__account_history", "checksum": {"name": "sha256", "checksum": "251225999aab9d1e1e4cac2cd4b988475ca6f8f4f4d09a5688fa3033bcab077b"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `account_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_description": {"name": "account_description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_name": {"name": "account_name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2498972, "relation_name": "\"postgres\".\"public_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='delta',\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "account"], ["salesforce_history", "account"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__account_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_account_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "model.salesforce.stg_salesforce__opportunity_history": {"database": "postgres", "schema": "public_salesforce_dev", "name": "stg_salesforce__opportunity_history", "resource_type": "model", "package_name": "salesforce", "path": "salesforce_history/staging/stg_salesforce__opportunity_history.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce__opportunity_history.sql", "unique_id": "model.salesforce.stg_salesforce__opportunity_history", "fqn": ["salesforce", "salesforce_history", "staging", "stg_salesforce__opportunity_history"], "alias": "stg_salesforce__opportunity_history", "checksum": {"name": "sha256", "checksum": "54a4ee8eb9b002d20fbc2501f2153d32581a63022ea1b7903efaeb721a9ce11c"}, "config": {"enabled": true, "alias": null, "schema": "salesforce_dev", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "incremental", "incremental_strategy": "delete+insert", "batch_size": null, "lookback": 1, "begin": null, "persist_docs": {"relation": true, "columns": true}, "post-hook": [], "pre-hook": [], "quoting": {}, "column_types": {}, "full_refresh": null, "unique_key": "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}, "event_time": null, "concurrent_batches": null, "access": "protected", "freshness": null, "partition_by": {"field": "_fivetran_date", "data_type": "date"}, "file_format": "delta"}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "history_unique_key": {"name": "history_unique_key", "description": "Surrogate key hashed on `_fivetran_start` and `opportunity_id`.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_description": {"name": "opportunity_description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_name": {"name": "opportunity_name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "group": null, "docs": {"show": true, "node_color": null}, "patch_path": "salesforce://models/salesforce_history/staging/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": "delta", "on_schema_change": "fail", "persist_docs": {"relation": true, "columns": "{{ false if target.type in ('databricks') else true }}"}, "schema": "salesforce_{{ var('directed_schema','dev') }}"}, "created_at": 1784132717.2543705, "relation_name": "\"postgres\".\"public_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='delta',\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [["salesforce_history", "opportunity"], ["salesforce_history", "opportunity"]], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.is_incremental", "macro.dbt.type_timestamp", "macro.dbt_utils.generate_surrogate_key", "macro.dbt_utils.star"], "nodes": ["source.salesforce.salesforce_history.opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql", "compiled": true, "compiled_code": "\n\nwith base as (\n\n select * \n from \"postgres\".\"public\".\"sf_opportunity_history_data\"\n \n where cast(_fivetran_start as timestamp) >= (select max(cast((_fivetran_start) as timestamp)) from \"postgres\".\"public_salesforce_dev\".\"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, "primary_key": ["history_unique_key"], "time_spine": null}, "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650": {"database": "postgres", "schema": "public_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, "static_analysis": 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": 1784132716.7527492, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7559419, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__manager_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7587235, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7614417, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__owner_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7644274, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7671602, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.769849, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.772411, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.775146, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7777257, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__daily_activity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.780379, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_salesforce__opportunity_d4eb5d5e1b8533ba4f6a5ae6c62b00a9\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132716.7830055, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_89e0ac11fd7024badcfec0c07b1a1c12\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_line_item_enhanced", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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.not_null_salesforce__campaign_performance_campaign_id.2efbe258b4": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_salesforce__campaign_performance_campaign_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__campaign_performance_campaign_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.not_null_salesforce__campaign_performance_campaign_id.2efbe258b4", "fqn": ["salesforce", "salesforce", "not_null_salesforce__campaign_performance_campaign_id"], "alias": "not_null_salesforce__campaign_performance_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132716.7855692, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__campaign_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__campaign_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/not_null_salesforce__campaign_performance_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_performance\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.salesforce__campaign_performance", "attached_node": "model.salesforce.salesforce__campaign_performance", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('salesforce__campaign_performance')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__campaign_performance_campaign_id.aea6ce66c5": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_salesforce__campaign_performance_campaign_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__campaign_performance_campaign_id.sql", "original_file_path": "models/salesforce/salesforce.yml", "unique_id": "test.salesforce.unique_salesforce__campaign_performance_campaign_id.aea6ce66c5", "fqn": ["salesforce", "salesforce", "unique_salesforce__campaign_performance_campaign_id"], "alias": "unique_salesforce__campaign_performance_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132716.7882588, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__campaign_performance", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__campaign_performance"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/salesforce.yml/unique_salesforce__campaign_performance_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_performance\"\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.salesforce__campaign_performance", "attached_node": "model.salesforce.salesforce__campaign_performance", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('salesforce__campaign_performance')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0337822, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__account_account_id.6d58a39ba7": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__account_account_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__account_account_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0366328, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__account", "test_metadata": {"name": "unique", "kwargs": {"column_name": "account_id", "model": "{{ get_where_subquery(ref('stg_salesforce__account')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0393074, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_opportunity_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportunity_opportunity_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0420156, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__opportunity", "test_metadata": {"name": "unique", "kwargs": {"column_name": "opportunity_id", "model": "{{ get_where_subquery(ref('stg_salesforce__opportunity')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0446143, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__user_user_id.9a29b41152": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__user_user_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__user_user_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0472257, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__user", "test_metadata": {"name": "unique", "kwargs": {"column_name": "user_id", "model": "{{ get_where_subquery(ref('stg_salesforce__user')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.049849, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__user_role_user_role_id.1259050718": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__user_role_user_role_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__user_role_user_role_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.052448, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__user_role", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__user_role"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__contact_contact_id.d7c02bef78": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0555968, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__contact_contact_id.0cc2c0609e": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__contact_contact_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__contact_contact_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.058262, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__contact", "test_metadata": {"name": "unique", "kwargs": {"column_name": "contact_id", "model": "{{ get_where_subquery(ref('stg_salesforce__contact')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0609808, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__event_event_id.13f7c8c0d9": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__event_event_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__event_event_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.0636144, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__event", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__event"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__event", "test_metadata": {"name": "unique", "kwargs": {"column_name": "event_id", "model": "{{ get_where_subquery(ref('stg_salesforce__event')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1574354, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__lead_lead_id.ba8b21e282": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__lead_lead_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__lead_lead_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1604006, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__lead", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__lead"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__lead", "test_metadata": {"name": "unique", "kwargs": {"column_name": "lead_id", "model": "{{ get_where_subquery(ref('stg_salesforce__lead')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1632335, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_stg_salesforce__oppor_cdeb75ef90723b483025a6ea3200473b\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.166147, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}{{ config(alias=\"unique_stg_salesforce__opportu_e7519b9845106f63a1bb91c4defd69e4\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_line_item", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_line_item"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__order_order_id.4782f3b34f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1688957, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__order_order_id.12a96b4e3c": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__order_order_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__order_order_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.171605, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__order", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__order"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__order", "test_metadata": {"name": "unique", "kwargs": {"column_name": "order_id", "model": "{{ get_where_subquery(ref('stg_salesforce__order')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1743205, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__product_2_product_2_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__product_2_product_2_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1769907, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__product_2", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__product_2"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.not_null_stg_salesforce__task_task_id.aabe11a5d9": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.1797981, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.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.unique_stg_salesforce__task_task_id.73684ed605": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__task_task_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__task_task_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605", "fqn": ["salesforce", "salesforce", "staging", "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, "static_analysis": 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": 1784132717.182446, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__task", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__task"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/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\".\"public_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.stg_salesforce__task", "test_metadata": {"name": "unique", "kwargs": {"column_name": "task_id", "model": "{{ get_where_subquery(ref('stg_salesforce__task')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__campaign_campaign_id.8a70e791fc": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__campaign_campaign_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__campaign_campaign_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__campaign_campaign_id.8a70e791fc", "fqn": ["salesforce", "salesforce", "staging", "not_null_stg_salesforce__campaign_campaign_id"], "alias": "not_null_stg_salesforce__campaign_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.1851203, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__campaign"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/not_null_stg_salesforce__campaign_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_id\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign\"\nwhere campaign_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_salesforce__campaign", "attached_node": "model.salesforce.stg_salesforce__campaign", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_salesforce__campaign')) }}"}, "namespace": null}}, "test.salesforce.unique_stg_salesforce__campaign_campaign_id.bb510c55b8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__campaign_campaign_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__campaign_campaign_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__campaign_campaign_id.bb510c55b8", "fqn": ["salesforce", "salesforce", "staging", "unique_stg_salesforce__campaign_campaign_id"], "alias": "unique_stg_salesforce__campaign_campaign_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.1877072, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__campaign", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__campaign"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/unique_stg_salesforce__campaign_campaign_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n campaign_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign\"\nwhere campaign_id is not null\ngroup by campaign_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_id", "file_key_name": "models.stg_salesforce__campaign", "attached_node": "model.salesforce.stg_salesforce__campaign", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_id", "model": "{{ get_where_subquery(ref('stg_salesforce__campaign')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__campaign_member_campaign_member_id.d1d111912d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__campaign_member_campaign_member_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__campaign_member_campaign_member_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__campaign_member_campaign_member_id.d1d111912d", "fqn": ["salesforce", "salesforce", "staging", "not_null_stg_salesforce__campaign_member_campaign_member_id"], "alias": "not_null_stg_salesforce__campaign_member_campaign_member_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.1905153, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__campaign_member", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__campaign_member"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/not_null_stg_salesforce__campaign_member_campaign_member_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_member_id\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign_member\"\nwhere campaign_member_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_member_id", "file_key_name": "models.stg_salesforce__campaign_member", "attached_node": "model.salesforce.stg_salesforce__campaign_member", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_member_id", "model": "{{ get_where_subquery(ref('stg_salesforce__campaign_member')) }}"}, "namespace": null}}, "test.salesforce.unique_stg_salesforce__campaign_member_campaign_member_id.c16f72906a": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__campaign_member_campaign_member_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__campaign_member_campaign_member_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__campaign_member_campaign_member_id.c16f72906a", "fqn": ["salesforce", "salesforce", "staging", "unique_stg_salesforce__campaign_member_campaign_member_id"], "alias": "unique_stg_salesforce__campaign_member_campaign_member_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.193136, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__campaign_member", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__campaign_member"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/unique_stg_salesforce__campaign_member_campaign_member_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n campaign_member_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__campaign_member\"\nwhere campaign_member_id is not null\ngroup by campaign_member_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_member_id", "file_key_name": "models.stg_salesforce__campaign_member", "attached_node": "model.salesforce.stg_salesforce__campaign_member", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_member_id", "model": "{{ get_where_subquery(ref('stg_salesforce__campaign_member')) }}"}, "namespace": null}}, "test.salesforce.not_null_stg_salesforce__record_type_record_type_id.68299cd5d2": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__record_type_record_type_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__record_type_record_type_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__record_type_record_type_id.68299cd5d2", "fqn": ["salesforce", "salesforce", "staging", "not_null_stg_salesforce__record_type_record_type_id"], "alias": "not_null_stg_salesforce__record_type_record_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.1956875, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__record_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__record_type"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/not_null_stg_salesforce__record_type_record_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect record_type_id\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__record_type\"\nwhere record_type_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type_id", "file_key_name": "models.stg_salesforce__record_type", "attached_node": "model.salesforce.stg_salesforce__record_type", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "record_type_id", "model": "{{ get_where_subquery(ref('stg_salesforce__record_type')) }}"}, "namespace": null}}, "test.salesforce.unique_stg_salesforce__record_type_record_type_id.be0e234aa9": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__record_type_record_type_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__record_type_record_type_id.sql", "original_file_path": "models/salesforce/staging/stg_salesforce.yml", "unique_id": "test.salesforce.unique_stg_salesforce__record_type_record_type_id.be0e234aa9", "fqn": ["salesforce", "salesforce", "staging", "unique_stg_salesforce__record_type_record_type_id"], "alias": "unique_stg_salesforce__record_type_record_type_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.1982393, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__record_type", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__record_type"]}, "compiled_path": "target/compiled/salesforce/models/salesforce/staging/stg_salesforce.yml/unique_stg_salesforce__record_type_record_type_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n record_type_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_salesforce_dev\".\"stg_salesforce__record_type\"\nwhere record_type_id is not null\ngroup by record_type_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "record_type_id", "file_key_name": "models.stg_salesforce__record_type", "attached_node": "model.salesforce.stg_salesforce__record_type", "test_metadata": {"name": "unique", "kwargs": {"column_name": "record_type_id", "model": "{{ get_where_subquery(ref('stg_salesforce__record_type')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__campaign_daily_history_campaign_day_id.78f6f75ca8": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_salesforce__campaign_daily_history_campaign_day_id", "resource_type": "test", "package_name": "salesforce", "path": "unique_salesforce__campaign_daily_history_campaign_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.unique_salesforce__campaign_daily_history_campaign_day_id.78f6f75ca8", "fqn": ["salesforce", "salesforce_history", "unique_salesforce__campaign_daily_history_campaign_day_id"], "alias": "unique_salesforce__campaign_daily_history_campaign_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.212762, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__campaign_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__campaign_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/unique_salesforce__campaign_daily_history_campaign_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\nselect\n campaign_day_id as unique_field,\n count(*) as n_records\n\nfrom \"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_daily_history\"\nwhere campaign_day_id is not null\ngroup by campaign_day_id\nhaving count(*) > 1\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_day_id", "file_key_name": "models.salesforce__campaign_daily_history", "attached_node": "model.salesforce.salesforce__campaign_daily_history", "test_metadata": {"name": "unique", "kwargs": {"column_name": "campaign_day_id", "model": "{{ get_where_subquery(ref('salesforce__campaign_daily_history')) }}"}, "namespace": null}}, "test.salesforce.not_null_salesforce__campaign_daily_history_campaign_day_id.05be30c879": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_salesforce__campaign_daily_history_campaign_day_id", "resource_type": "test", "package_name": "salesforce", "path": "not_null_salesforce__campaign_daily_history_campaign_day_id.sql", "original_file_path": "models/salesforce_history/salesforce_history.yml", "unique_id": "test.salesforce.not_null_salesforce__campaign_daily_history_campaign_day_id.05be30c879", "fqn": ["salesforce", "salesforce_history", "not_null_salesforce__campaign_daily_history_campaign_day_id"], "alias": "not_null_salesforce__campaign_daily_history_campaign_day_id", "checksum": {"name": "none", "checksum": ""}, "config": {"enabled": true, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "where": null, "limit": null, "fail_calc": "count(*)", "warn_if": "!= 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": 1784132717.215414, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__campaign_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.salesforce__campaign_daily_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/salesforce_history.yml/not_null_salesforce__campaign_daily_history_campaign_day_id.sql", "compiled": true, "compiled_code": "\n \n \n\n\n\nselect campaign_day_id\nfrom \"postgres\".\"public_salesforce_dev\".\"salesforce__campaign_daily_history\"\nwhere campaign_day_id is null\n\n\n", "extra_ctes_injected": true, "extra_ctes": [], "contract": {"enforced": false, "alias_types": true, "checksum": null}, "column_name": "campaign_day_id", "file_key_name": "models.salesforce__campaign_daily_history", "attached_node": "model.salesforce.salesforce__campaign_daily_history", "test_metadata": {"name": "not_null", "kwargs": {"column_name": "campaign_day_id", "model": "{{ get_where_subquery(ref('salesforce__campaign_daily_history')) }}"}, "namespace": null}}, "test.salesforce.unique_salesforce__account_daily_history_account_day_id.0a35b2e581": {"database": "postgres", "schema": "public_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, "static_analysis": 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": 1784132717.2180576, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132717.2207181, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__account_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132717.2233257, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132717.2258832, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__contact_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132717.2284698, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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": "public_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, "static_analysis": 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": 1784132717.2312458, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}{{ config(alias=\"not_null_salesforce__opportuni_1e7321269fc636be92c02e02abd5dc1f\") }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "salesforce__opportunity_daily_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "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\".\"public_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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.2555957, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__account_history_history_unique_key.c378da769f": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__account_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__account_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.2584443, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__account_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__account_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.2611341, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__contact_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__contact_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.2638676, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__contact_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__contact_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "not_null_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "not_null_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.266572, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_not_null", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": {"database": "postgres", "schema": "public_dbt_test__audit", "name": "unique_stg_salesforce__opportunity_history_history_unique_key", "resource_type": "test", "package_name": "salesforce", "path": "unique_stg_salesforce__opportunity_history_history_unique_key.sql", "original_file_path": "models/salesforce_history/staging/stg_salesforce_history.yml", "unique_id": "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67", "fqn": ["salesforce", "salesforce_history", "staging", "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, "static_analysis": 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": 1784132717.2691894, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "doc_blocks": [], "language": "sql", "refs": [{"name": "stg_salesforce__opportunity_history", "package": null, "version": null}], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.test_unique", "macro.dbt.get_where_subquery"], "nodes": ["model.salesforce.stg_salesforce__opportunity_history"]}, "compiled_path": "target/compiled/salesforce/models/salesforce_history/staging/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\".\"public_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.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}}}, "sources": {"source.salesforce.salesforce.account": {"database": "postgres", "schema": "public", "name": "account", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.account", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "Fax number for the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Phone number for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode for the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_longitude": {"name": "shipping_longitude", "description": "Used with ShippingLatitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "site": {"name": "site", "description": "Name of the account\u2019s location, for example Headquarters or London.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_account_data\"", "created_at": 1784132717.2996516, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.opportunity": {"database": "postgres", "schema": "public", "name": "opportunity", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.opportunity", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_data\"", "created_at": 1784132717.3020525, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.user": {"database": "postgres", "schema": "public", "name": "user", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.user", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "about_me": {"name": "about_me", "description": "Information about the user, such as areas of interest or skills.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "alias": {"name": "alias", "description": "Required. The user\u2019s alias. For example, jsmith.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "banner_photo_url": {"name": "banner_photo_url", "description": "The URL for the user's banner photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "The city associated with the user. Up to 40 characters allowed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company_name": {"name": "company_name", "description": "The name of the user\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The country associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The company department associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "division": {"name": "division", "description": "The division associated with this user, similar to Department and unrelated to DefaultDivision.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "Required. The user\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "employee_number": {"name": "employee_number", "description": "The user\u2019s employee number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "extension": {"name": "extension", "description": "The user\u2019s phone extension number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The user\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The user\u2019s first name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "full_photo_url": {"name": "full_photo_url", "description": "The URL for the user's profile photo.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. The user\u2019s last name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "latitude": {"name": "latitude", "description": "Used with Longitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "longitude": {"name": "longitude", "description": "Used with Latitude to specify the precise geolocation of an address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "manager_id": {"name": "manager_id", "description": "The Id of the user who manages this user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The user\u2019s mobile or cellular phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName and LastName.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The user\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "postal_code": {"name": "postal_code", "description": "The user\u2019s postal or ZIP code.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "signature": {"name": "signature", "description": "The signature text added to emails.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "The state associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code associated with the user.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "The street address associated with the User.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "The user\u2019s business title, such as \u201cVice President.\u201d", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_role_id": {"name": "user_role_id", "description": "ID of the user\u2019s UserRole.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "user_type": {"name": "user_type", "description": "The category of user license.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_user_data\"", "created_at": 1784132717.3029268, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.user_role": {"database": "postgres", "schema": "public", "name": "user_role", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.user_role", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True, if this field has been deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the role. Corresponds to Label on the user interface.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_role_id": {"name": "parent_role_id", "description": "The ID of the parent role.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "portal_type": {"name": "portal_type", "description": "This value indicates the type of portal for the role", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rollup_description": {"name": "rollup_description", "description": "Description of the forecast rollup.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_user_role_data\"", "created_at": 1784132717.3034742, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.contact": {"database": "postgres", "schema": "public", "name": "contact", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.contact", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "assistant_name": {"name": "assistant_name", "description": "The assistant\u2019s name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "assistant_phone": {"name": "assistant_phone", "description": "The assistant\u2019s telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "birthdate": {"name": "birthdate", "description": "The contact\u2019s birthdate.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "department": {"name": "department", "description": "The contact\u2019s department.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The contact\u2019s fax number. Label is Business Fax.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw": {"name": "jigsaw", "description": "Data.com Key", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw contact OD", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_curequest_date": {"name": "last_curequest_date", "description": "Last Stay-in-Touch Request Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_cuupdate_date": {"name": "last_cuupdate_date", "description": "Last Stay-in-Touch Save Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "Mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street address for mailing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_city": {"name": "other_city", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_country": {"name": "other_country", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_phone": {"name": "other_phone", "description": "Telephone for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_postal_code": {"name": "other_postal_code", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_state": {"name": "other_state", "description": "Alternate address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "other_street": {"name": "other_street", "description": "Street for alternate address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_contact_data\"", "created_at": 1784132717.3042645, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.event": {"database": "postgres", "schema": "public", "name": "event", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.event", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Contains a text description of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "duration_in_minutes": {"name": "duration_in_minutes", "description": "Contains the event length, in minutes\n", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "group_event_type": {"name": "group_event_type", "description": "Group Event Type", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "location": {"name": "location", "description": "Contains the location of the event.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "Indicates the interval between Salesforce Classic recurring events.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "subject": {"name": "subject", "description": "The subject line of the event, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Indicates the event type, such as Call, Email, or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_event_data\"", "created_at": 1784132717.3049963, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.lead": {"database": "postgres", "schema": "public", "name": "lead", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.lead", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Annual revenue for the lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "city": {"name": "city", "description": "City for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "company": {"name": "company", "description": "Required. The lead\u2019s company.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "converted_date": {"name": "converted_date", "description": "Date on which this lead was converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country": {"name": "country", "description": "The lead\u2019s country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "country_code": {"name": "country_code", "description": "The ISO country code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "The lead\u2019s description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The lead\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fax": {"name": "fax", "description": "The lead\u2019s fax number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The lead\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "geocode_accuracy": {"name": "geocode_accuracy", "description": "Accuracy level of the geocode for the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "Industry in which the lead works.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "jigsaw_contact_id": {"name": "jigsaw_contact_id", "description": "Jigsaw Contact ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the lead up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "The lead\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "The lead\u2019s phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "photo_url": {"name": "photo_url", "description": "Path to be combined with the URL of a Salesforce instance", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "salutation": {"name": "salutation", "description": "Salutation for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state": {"name": "state", "description": "State for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "state_code": {"name": "state_code", "description": "The ISO state code for the lead\u2019s address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "street": {"name": "street", "description": "Street number and name for the address of the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title for the lead, such as CFO or CEO.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "Website for the lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_lead_data\"", "created_at": 1784132717.3056707, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.opportunity_line_item": {"database": "postgres", "schema": "public", "name": "opportunity_line_item", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.opportunity_line_item", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity line item.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "Required. ID of the associated Opportunity. This is a relationship field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_line_item_data\"", "created_at": 1784132717.3062887, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.order": {"database": "postgres", "schema": "public", "name": "order", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.order", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "activated_date": {"name": "activated_date", "description": "Date and time when the order was activated.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_geocode_accuracy": {"name": "billing_geocode_accuracy", "description": "Accuracy level of the geocode of the address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state_code": {"name": "billing_state_code", "description": "ISO state code for the order\u2019s billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Description of the order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Date at which the order ends. Label is Order End Date.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "opportunity_id": {"name": "opportunity_id", "description": "ID for the opportunity that\u2019s associated with this order.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "City of the shipping address. Maximum size is 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Country of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country_code": {"name": "shipping_country_code", "description": "ISO country code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_geocode_accuracy": {"name": "shipping_geocode_accuracy", "description": "Accuracy level of the geocode of the shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "State of the shipping address. Maximum size is 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state_code": {"name": "shipping_state_code", "description": "ISO state code for the order\u2019s shipping address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "Street address of the shipping address. Maximum of 255 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_order_data\"", "created_at": 1784132717.3069887, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.product_2": {"database": "postgres", "schema": "public", "name": "product_2", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.product_2", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A text description of this record. Label is Product Description.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "external_data_source_id": {"name": "external_data_source_id", "description": "ID of the related external data source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Describes whether the product is archived. The default value is false.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Default name of this record. Label is Product Name.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_product_2_data\"", "created_at": 1784132717.3076065, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.task": {"database": "postgres", "schema": "public", "name": "task", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.task", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "call_type": {"name": "call_type", "description": "The type of call being answered: Inbound, Internal, or Outbound.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "Created By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Created Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Contains a text description of the task.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_archived": {"name": "is_archived", "description": "Indicates whether the event has been archived.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_deleted": {"name": "is_deleted", "description": "Deleted", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "recurrence_interval": {"name": "recurrence_interval", "description": "The interval between recurring tasks.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "system_modstamp": {"name": "system_modstamp", "description": "System Modstamp", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "The type of task, such as Call or Meeting.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_task_data\"", "created_at": 1784132717.3082917, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.campaign": {"database": "postgres", "schema": "public", "name": "campaign", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.campaign", "fqn": ["salesforce", "salesforce", "staging", "salesforce", "campaign"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_campaign_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents a marketing campaign, such as a direct mail promotion, webinar, or trade show.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "actual_cost": {"name": "actual_cost", "description": "Amount of money spent to run the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "amount_all_opportunities": {"name": "amount_all_opportunities", "description": "Total amount of all opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "budgeted_cost": {"name": "budgeted_cost", "description": "Amount of money budgeted for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Description of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Ending date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether the campaign is active (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_contacts": {"name": "number_of_contacts", "description": "Number of contacts associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_converted_leads": {"name": "number_of_converted_leads", "description": "Number of leads associated with the campaign that have been converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_leads": {"name": "number_of_leads", "description": "Number of leads associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_opportunities": {"name": "number_of_opportunities", "description": "Number of opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_responses": {"name": "number_of_responses", "description": "Number of contacts and leads that have a campaign member status where the Has Responded field is true.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_won_opportunities": {"name": "number_of_won_opportunities", "description": "Number of opportunities associated with the campaign that have a probability of 100% because they are closed and won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_record_type_id": {"name": "campaign_member_record_type_id", "description": "ID of the record type assigned to campaign members of this campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "The ID of the parent campaign, if applicable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "start_date": {"name": "start_date", "description": "Starting date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the campaign, such as Planned, In Progress, or Completed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of campaign, such as Direct Mail, Email, or Webinar.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_campaign_data\"", "created_at": 1784132717.3098192, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.campaign_member": {"database": "postgres", "schema": "public", "name": "campaign_member", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.campaign_member", "fqn": ["salesforce", "salesforce", "staging", "salesforce", "campaign_member"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_campaign_member_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents the relationship between a campaign and either a lead or a contact.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with the contact or lead.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_id": {"name": "campaign_id", "description": "Required. ID of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "contact_id": {"name": "contact_id", "description": "ID of the contact associated with this campaign member. Either ContactId or LeadId must be specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_by_id": {"name": "created_by_id", "description": "ID of the user who created the campaign member record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the campaign member record was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_responded_date": {"name": "first_responded_date", "description": "Date when the contact or lead first responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "has_opted_out_of_email": {"name": "has_opted_out_of_email", "description": "Indicates whether the contact or lead has opted out of email communications.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "has_responded": {"name": "has_responded", "description": "Indicates whether the contact or lead has responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "ID of the user who last modified the campaign member record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_id": {"name": "lead_id", "description": "ID of the lead associated with this campaign member. Either ContactId or LeadId must be specified.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_or_contact_id": {"name": "lead_or_contact_id", "description": "ID of the lead or contact associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_or_contact_owner_id": {"name": "lead_or_contact_owner_id", "description": "ID of the owner of the lead or contact associated with this campaign member.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "The status of the campaign member, such as Sent or Responded.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_campaign_member_data\"", "created_at": 1784132717.310528, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.record_type": {"database": "postgres", "schema": "public", "name": "record_type", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.record_type", "fqn": ["salesforce", "salesforce", "staging", "salesforce", "record_type"], "source_name": "salesforce", "source_description": "", "loader": "fivetran", "identifier": "sf_record_type_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": null, "external": null, "description": "Represents a record type, which allows you to offer different business processes, picklist values, and page layouts to different users.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_deleted": {"name": "_fivetran_deleted", "description": "True if the record has been deleted in Salesforce.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Description of the record type.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "developer_name": {"name": "developer_name", "description": "The unique name of the object in the API.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether this record type is available for use.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Label for this record type. This display value is the unique, identifying label visible to users.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "namespace_prefix": {"name": "namespace_prefix", "description": "The namespace prefix associated with this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "sobject_type": {"name": "sobject_type", "description": "The Salesforce object that this record type applies to.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": null, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": null, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_record_type_data\"", "created_at": 1784132717.3110418, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.fivetran_formula": {"database": "postgres", "schema": "public", "name": "fivetran_formula", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.fivetran_formula", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"fivetran_formula\"", "created_at": 1784132717.3116493, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce.fivetran_formula_model": {"database": "postgres", "schema": "public", "name": "fivetran_formula_model", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce/staging/src_salesforce.yml", "original_file_path": "models/salesforce/staging/src_salesforce.yml", "unique_id": "source.salesforce.salesforce.fivetran_formula_model", "fqn": ["salesforce", "salesforce", "staging", "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", "loaded_at_query": null, "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, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"fivetran_formula_model\"", "created_at": 1784132717.3123848, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_schema', 'salesforce') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.campaign": {"database": "postgres", "schema": "public", "name": "campaign", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.campaign", "fqn": ["salesforce", "salesforce_history", "staging", "salesforce_history", "campaign"], "source_name": "salesforce_history", "source_description": "", "loader": "fivetran", "identifier": "sf_campaign_history_data", "quoting": {"database": null, "schema": null, "identifier": null, "column": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "external": null, "description": "Represents historical records of campaigns, which are outreach initiatives designed to generate leads and track revenue.", "columns": {"id": {"name": "id", "description": "The unique, system-generated ID assigned during creation.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "actual_cost": {"name": "actual_cost", "description": "Amount of money spent to run the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "amount_all_opportunities": {"name": "amount_all_opportunities", "description": "Total amount of all opportunities associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "budgeted_cost": {"name": "budgeted_cost", "description": "Amount of money budgeted for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "campaign_member_record_type_id": {"name": "campaign_member_record_type_id", "description": "ID of the record type assigned to campaign members of this campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "end_date": {"name": "end_date", "description": "Ending date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_active": {"name": "is_active", "description": "Indicates whether the campaign is active (true) or not (false).", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Name of the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_contacts": {"name": "number_of_contacts", "description": "Number of contacts associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_converted_leads": {"name": "number_of_converted_leads", "description": "Number of leads associated with the campaign that have been converted.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_leads": {"name": "number_of_leads", "description": "Number of leads associated with the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_opportunities": {"name": "number_of_opportunities", "description": "Number of opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_responses": {"name": "number_of_responses", "description": "Number of contacts and leads that responded to the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "number_of_won_opportunities": {"name": "number_of_won_opportunities", "description": "Number of closed-won opportunities where this campaign is the primary campaign source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "The ID of the parent campaign, if applicable.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "start_date": {"name": "start_date", "description": "Starting date for the campaign.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "status": {"name": "status", "description": "Status of the campaign, such as Planned, In Progress, or Completed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of campaign, such as Direct Mail, Email, or Webinar.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_campaign_history_data\"", "created_at": 1784132717.3131979, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.account": {"database": "postgres", "schema": "public", "name": "account", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.account", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "annual_revenue": {"name": "annual_revenue", "description": "Estimated annual revenue of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_city": {"name": "billing_city", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_country": {"name": "billing_country", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_postal_code": {"name": "billing_postal_code", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_state": {"name": "billing_state", "description": "Details for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "billing_street": {"name": "billing_street", "description": "Street address for the billing address of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "industry": {"name": "industry", "description": "An industry associated with this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. Name of the account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "owner_id": {"name": "owner_id", "description": "The ID of the user who currently owns this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "ownership": {"name": "ownership", "description": "Ownership type for the account, for example Private, Public, or Subsidiary.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "parent_id": {"name": "parent_id", "description": "ID of the parent object, if any.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "rating": {"name": "rating", "description": "The account\u2019s prospect rating, for example Hot, Warm, or Cold.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_city": {"name": "shipping_city", "description": "Details of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_country": {"name": "shipping_country", "description": "Details of the shipping address for this account. Country.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_state": {"name": "shipping_state", "description": "Details of the shipping address for this account. State.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "shipping_street": {"name": "shipping_street", "description": "The street address of the shipping address for this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of account, for example, Customer, Competitor, or Partner.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "website": {"name": "website", "description": "The website of this account.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_account_history_data\"", "created_at": 1784132717.3140118, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.contact": {"database": "postgres", "schema": "public", "name": "contact", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.contact", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account that\u2019s the parent of this contact.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "A description of the contact. Label is Contact Description up to 32 KB.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "email": {"name": "email", "description": "The contact\u2019s email address.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "first_name": {"name": "first_name", "description": "The contact\u2019s first name up to 40 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "home_phone": {"name": "home_phone", "description": "The contact\u2019s home telephone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_by_id": {"name": "last_modified_by_id", "description": "Last Modified By ID", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_modified_date": {"name": "last_modified_date", "description": "Last Modified Date", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "last_name": {"name": "last_name", "description": "Required. Last name of the contact up to 80 characters.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "The lead\u2019s source.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_city": {"name": "mailing_city", "description": "City mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_country": {"name": "mailing_country", "description": "Country mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_postal_code": {"name": "mailing_postal_code", "description": "Postal code mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_state": {"name": "mailing_state", "description": "State mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mailing_street": {"name": "mailing_street", "description": "Street mailing address details.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "mobile_phone": {"name": "mobile_phone", "description": "Contact\u2019s mobile phone number.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Concatenation of FirstName, MiddleName, LastName, and Suffix up to 203 characters, including whitespaces.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "phone": {"name": "phone", "description": "Telephone number for the contact. Label is Business Phone.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "title": {"name": "title", "description": "Title", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_contact_history_data\"", "created_at": 1784132717.3148563, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}, "source.salesforce.salesforce_history.opportunity": {"database": "postgres", "schema": "public", "name": "opportunity", "resource_type": "source", "package_name": "salesforce", "path": "models/salesforce_history/staging/src_salesforce_history.yml", "original_file_path": "models/salesforce_history/staging/src_salesforce_history.yml", "unique_id": "source.salesforce.salesforce_history.opportunity", "fqn": ["salesforce", "salesforce_history", "staging", "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", "loaded_at_query": null, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "_fivetran_synced": {"name": "_fivetran_synced", "description": "The time at which fivetran last synced this record.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "account_id": {"name": "account_id", "description": "ID of the account associated with this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "close_date": {"name": "close_date", "description": "Required. Date when the opportunity is expected to close.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "created_date": {"name": "created_date", "description": "Date when the opportunity is was created.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "description": {"name": "description", "description": "Text description of the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "fiscal_year": {"name": "fiscal_year", "description": "Represents the fiscal year, for example, 2006.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category": {"name": "forecast_category", "description": "Restricted picklist field.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "forecast_category_name": {"name": "forecast_category_name", "description": "The name of the forecast category.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_closed": {"name": "is_closed", "description": "True, if Stage Name Label is Closed.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "is_won": {"name": "is_won", "description": "True, if Stage Name Label is Won.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "lead_source": {"name": "lead_source", "description": "Source of this opportunity, such as Advertisement or Trade Show.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "name": {"name": "name", "description": "Required. A name for this opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "next_step": {"name": "next_step", "description": "Description of next task in closing opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "probability": {"name": "probability", "description": "Percentage of estimated confidence in closing the opportunity.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "record_type_id": {"name": "record_type_id", "description": "ID of the record type assigned to this object.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "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, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}, "type": {"name": "type", "description": "Type of opportunity. For example, Existing Business or New Business.", "meta": {}, "data_type": null, "constraints": [], "quote": null, "config": {"meta": {}, "tags": []}, "tags": [], "granularity": null, "doc_blocks": []}}, "meta": {}, "source_meta": {}, "tags": [], "config": {"enabled": true, "event_time": null, "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "loaded_at_field": "_fivetran_synced", "loaded_at_query": null, "meta": {}, "tags": [], "static_analysis": null}, "patch_path": null, "unrendered_config": {"loaded_at_field": "_fivetran_synced", "freshness": {"warn_after": {"count": 24, "period": "hour"}, "error_after": {"count": 48, "period": "hour"}, "filter": null}, "enabled": true, "loaded_at_query": null, "meta": {}, "tags": []}, "relation_name": "\"postgres\".\"public\".\"sf_opportunity_history_data\"", "created_at": 1784132717.3156562, "unrendered_database": "{% if target.type != 'spark'%}{{ var('salesforce_history_database', target.database) }}{% endif %}", "unrendered_schema": "{{ var('salesforce_history_schema', 'salesforce_history') }}", "doc_blocks": []}}, "macros": {"macro.dbt_postgres.postgres__get_catalog_relations": {"name": "postgres__get_catalog_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2244911, "supported_languages": null}, "macro.dbt_postgres.postgres__get_catalog": {"name": "postgres__get_catalog", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/catalog.sql", "original_file_path": "macros/catalog.sql", "unique_id": "macro.dbt_postgres.postgres__get_catalog", "macro_sql": "{% macro postgres__get_catalog(information_schema, schemas) -%}\n {%- set relations = [] -%}\n {%- for schema in schemas -%}\n {%- set dummy = relations.append({'schema': schema}) -%}\n {%- endfor -%}\n {{ return(postgres__get_catalog_relations(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2252805, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp": {"name": "postgres__current_timestamp", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp", "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2257273, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_string_as_time": {"name": "postgres__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_string_as_time", "macro_sql": "{% macro postgres__snapshot_string_as_time(timestamp) -%}\n {%- set result = \"'\" ~ timestamp ~ \"'::timestamp without time zone\" -%}\n {{ return(result) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.226214, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_get_time": {"name": "postgres__snapshot_get_time", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_get_time", "macro_sql": "{% macro postgres__snapshot_get_time() -%}\n {{ current_timestamp() }}::timestamp without time zone\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2264473, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_backcompat": {"name": "postgres__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_backcompat", "macro_sql": "{% macro postgres__current_timestamp_backcompat() %}\n current_timestamp::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2267559, "supported_languages": null}, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": {"name": "postgres__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/timestamps.sql", "original_file_path": "macros/timestamps.sql", "unique_id": "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro postgres__current_timestamp_in_utc_backcompat() %}\n (current_timestamp at time zone 'utc')::{{ type_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.227043, "supported_languages": null}, "macro.dbt_postgres.postgres__get_relations": {"name": "postgres__get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres__get_relations", "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n select distinct\n dependent_namespace.nspname as dependent_schema,\n dependent_class.relname as dependent_name,\n referenced_namespace.nspname as referenced_schema,\n referenced_class.relname as referenced_name\n\n -- Query for views: views are entries in pg_class with an entry in pg_rewrite, but we avoid\n -- a seq scan on pg_rewrite by leveraging the fact there is an \"internal\" row in pg_depend for\n -- the view...\n from pg_class as dependent_class\n join pg_namespace as dependent_namespace on dependent_namespace.oid = dependent_class.relnamespace\n join pg_depend as dependent_depend on dependent_depend.refobjid = dependent_class.oid\n and dependent_depend.classid = 'pg_rewrite'::regclass\n and dependent_depend.refclassid = 'pg_class'::regclass\n and dependent_depend.deptype = 'i'\n\n -- ... and via pg_depend (that has a row per column, hence the need for \"distinct\" above, and\n -- making sure to exclude the internal row to avoid a view appearing to depend on itself)...\n join pg_depend as joining_depend on joining_depend.objid = dependent_depend.objid\n and joining_depend.classid = 'pg_rewrite'::regclass\n and joining_depend.refclassid = 'pg_class'::regclass\n and joining_depend.refobjid != dependent_depend.refobjid\n\n -- ... we can find the tables they query from in pg_class, but excluding system tables. Note we\n -- don't need need to exclude _dependent_ system tables, because they only query from other\n -- system tables, and so are automatically excluded by excluding _referenced_ system tables\n join pg_class as referenced_class on referenced_class.oid = joining_depend.refobjid\n join pg_namespace as referenced_namespace on referenced_namespace.oid = referenced_class.relnamespace\n and referenced_namespace.nspname != 'information_schema'\n and referenced_namespace.nspname not like 'pg\\_%'\n\n order by\n dependent_schema, dependent_name, referenced_schema, referenced_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2280302, "supported_languages": null}, "macro.dbt_postgres.postgres_get_relations": {"name": "postgres_get_relations", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations.sql", "original_file_path": "macros/relations.sql", "unique_id": "macro.dbt_postgres.postgres_get_relations", "macro_sql": "{% macro postgres_get_relations() %}\n {{ return(postgres__get_relations()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2282999, "supported_languages": null}, "macro.dbt_postgres.postgres__create_table_as": {"name": "postgres__create_table_as", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_table_as", "macro_sql": "{% macro postgres__create_table_as(temporary, relation, sql) -%}\n {%- set unlogged = config.get('unlogged', default=false) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary -%}\n temporary\n {%- elif unlogged -%}\n unlogged\n {%- endif %} table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {% endif -%}\n {% if contract_config.enforced and (not temporary) -%}\n {{ get_table_columns_and_constraints() }} ;\n insert into {{ relation }} (\n {{ adapter.dispatch('get_column_names', 'dbt')() }}\n )\n {%- set sql = get_select_subquery(sql) %}\n {% else %}\n as\n {% endif %}\n (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.default__get_column_names", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2326648, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_index_sql": {"name": "postgres__get_create_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_index_sql", "macro_sql": "{% macro postgres__get_create_index_sql(relation, index_dict) -%}\n {%- set index_config = adapter.parse_index(index_dict) -%}\n {%- set comma_separated_columns = \", \".join(index_config.columns) -%}\n {%- set index_name = index_config.render(relation) -%}\n\n create {% if index_config.unique -%}\n unique\n {%- endif %} index if not exists\n \"{{ index_name }}\"\n on {{ relation }} {% if index_config.type -%}\n using {{ index_config.type }}\n {%- endif %}\n ({{ comma_separated_columns }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2336829, "supported_languages": null}, "macro.dbt_postgres.postgres__create_schema": {"name": "postgres__create_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__create_schema", "macro_sql": "{% macro postgres__create_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier().include(database=False) }}\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2343314, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_schema": {"name": "postgres__drop_schema", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__drop_schema", "macro_sql": "{% macro postgres__drop_schema(relation) -%}\n {% if relation.database -%}\n {{ adapter.verify_database(relation.database) }}\n {%- endif -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier().include(database=False) }} cascade\n {%- endcall -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2349668, "supported_languages": null}, "macro.dbt_postgres.postgres__get_columns_in_relation": {"name": "postgres__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_columns_in_relation", "macro_sql": "{% macro postgres__get_columns_in_relation(relation) -%}\n {% call statement('get_columns_in_relation', fetch_result=True) %}\n select\n column_name,\n data_type,\n character_maximum_length,\n numeric_precision,\n numeric_scale\n\n from {{ relation.information_schema('columns') }}\n where table_name = '{{ relation.identifier }}'\n {% if relation.schema %}\n and table_schema = '{{ relation.schema }}'\n {% endif %}\n order by ordinal_position\n\n {% endcall %}\n {% set table = load_result('get_columns_in_relation').table %}\n {{ return(sql_convert_columns_in_relation(table)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.sql_convert_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2359028, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2367613, "supported_languages": null}, "macro.dbt_postgres.postgres__information_schema_name": {"name": "postgres__information_schema_name", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__information_schema_name", "macro_sql": "{% macro postgres__information_schema_name(database) -%}\n {% if database_name -%}\n {{ adapter.verify_database(database_name) }}\n {%- endif -%}\n information_schema\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2371469, "supported_languages": null}, "macro.dbt_postgres.postgres__list_schemas": {"name": "postgres__list_schemas", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__list_schemas", "macro_sql": "{% macro postgres__list_schemas(database) %}\n {% if database -%}\n {{ adapter.verify_database(database) }}\n {%- endif -%}\n {% call statement('list_schemas', fetch_result=True, auto_begin=False) %}\n select distinct nspname from pg_namespace\n {% endcall %}\n {{ return(load_result('list_schemas').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2378714, "supported_languages": null}, "macro.dbt_postgres.postgres__check_schema_exists": {"name": "postgres__check_schema_exists", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__check_schema_exists", "macro_sql": "{% macro postgres__check_schema_exists(information_schema, schema) -%}\n {% if information_schema.database -%}\n {{ adapter.verify_database(information_schema.database) }}\n {%- endif -%}\n {% call statement('check_schema_exists', fetch_result=True, auto_begin=False) %}\n select count(*) from pg_namespace where nspname = '{{ schema }}'\n {% endcall %}\n {{ return(load_result('check_schema_exists').table) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2386527, "supported_languages": null}, "macro.dbt_postgres.postgres__make_relation_with_suffix": {"name": "postgres__make_relation_with_suffix", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_relation_with_suffix", "macro_sql": "{% macro postgres__make_relation_with_suffix(base_relation, suffix, dstring) %}\n {% if dstring %}\n {% set dt = modules.datetime.datetime.now() %}\n {% set dtstring = dt.strftime(\"%H%M%S%f\") %}\n {% set suffix = suffix ~ dtstring %}\n {% endif %}\n {% set suffix_length = suffix|length %}\n {% set relation_max_name_length = base_relation.relation_max_name_length() %}\n {% if suffix_length > relation_max_name_length %}\n {% do exceptions.raise_compiler_error('Relation suffix is too long (' ~ suffix_length ~ ' characters). Maximum length is ' ~ relation_max_name_length ~ ' characters.') %}\n {% endif %}\n {% set identifier = base_relation.identifier[:relation_max_name_length - suffix_length] ~ suffix %}\n\n {{ return(base_relation.incorporate(path={\"identifier\": identifier })) }}\n\n {% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2404304, "supported_languages": null}, "macro.dbt_postgres.postgres__make_intermediate_relation": {"name": "postgres__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_intermediate_relation", "macro_sql": "{% macro postgres__make_intermediate_relation(base_relation, suffix) %}\n {{ return(postgres__make_relation_with_suffix(base_relation, suffix, dstring=False)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2408185, "supported_languages": null}, "macro.dbt_postgres.postgres__make_temp_relation": {"name": "postgres__make_temp_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_temp_relation", "macro_sql": "{% macro postgres__make_temp_relation(base_relation, suffix) %}\n {% set temp_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=True) %}\n {{ return(temp_relation.incorporate(path={\"schema\": none,\n \"database\": none})) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2414577, "supported_languages": null}, "macro.dbt_postgres.postgres__make_backup_relation": {"name": "postgres__make_backup_relation", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__make_backup_relation", "macro_sql": "{% macro postgres__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {% set backup_relation = postgres__make_relation_with_suffix(base_relation, suffix, dstring=False) %}\n {{ return(backup_relation.incorporate(type=backup_relation_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_relation_with_suffix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2420137, "supported_languages": null}, "macro.dbt_postgres.postgres_escape_comment": {"name": "postgres_escape_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres_escape_comment", "macro_sql": "{% macro postgres_escape_comment(comment) -%}\n {% if comment is not string %}\n {% do exceptions.raise_compiler_error('cannot escape a non-string: ' ~ comment) %}\n {% endif %}\n {%- set magic = '$dbt_comment_literal_block$' -%}\n {%- if magic in comment -%}\n {%- do exceptions.raise_compiler_error('The string ' ~ magic ~ ' is not allowed in comments.') -%}\n {%- endif -%}\n {{ magic }}{{ comment }}{{ magic }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2428827, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_relation_comment": {"name": "postgres__alter_relation_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_relation_comment", "macro_sql": "{% macro postgres__alter_relation_comment(relation, comment) %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n {% if relation.type == 'materialized_view' -%}\n {% set relation_type = \"materialized view\" %}\n {%- else -%}\n {%- set relation_type = relation.type -%}\n {%- endif -%}\n comment on {{ relation_type }} {{ relation }} is {{ escaped_comment }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2436328, "supported_languages": null}, "macro.dbt_postgres.postgres__alter_column_comment": {"name": "postgres__alter_column_comment", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__alter_column_comment", "macro_sql": "{% macro postgres__alter_column_comment(relation, column_dict) %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% for column_name in column_dict if (column_name in existing_columns) %}\n {% set comment = column_dict[column_name]['description'] %}\n {% set escaped_comment = postgres_escape_comment(comment) %}\n comment on column {{ relation }}.{{ adapter.quote(column_name) if column_dict[column_name]['quote'] else column_name }} is {{ escaped_comment }};\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres_escape_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.244818, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_grant_sql": {"name": "postgres__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_grant_sql", "macro_sql": "\n\n{%- macro postgres__get_show_grant_sql(relation) -%}\n select grantee, privilege_type\n from {{ relation.information_schema('role_table_grants') }}\n where grantor = current_role\n and grantee != current_role\n and table_schema = '{{ relation.schema }}'\n and table_name = '{{ relation.identifier }}'\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2452548, "supported_languages": null}, "macro.dbt_postgres.postgres__copy_grants": {"name": "postgres__copy_grants", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__copy_grants", "macro_sql": "{% macro postgres__copy_grants() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2454967, "supported_languages": null}, "macro.dbt_postgres.postgres__get_show_indexes_sql": {"name": "postgres__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_show_indexes_sql", "macro_sql": "{% macro postgres__get_show_indexes_sql(relation) %}\n select\n i.relname as name,\n m.amname as method,\n ix.indisunique as \"unique\",\n array_to_string(array_agg(a.attname), ',') as column_names\n from pg_index ix\n join pg_class i\n on i.oid = ix.indexrelid\n join pg_am m\n on m.oid=i.relam\n join pg_class t\n on t.oid = ix.indrelid\n join pg_namespace n\n on n.oid = t.relnamespace\n join pg_attribute a\n on a.attrelid = t.oid\n and a.attnum = ANY(ix.indkey)\n where t.relname = '{{ relation.identifier }}'\n and n.nspname = '{{ relation.schema }}'\n and t.relkind in ('r', 'm')\n group by 1, 2, 3\n order by 1, 2, 3\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.245871, "supported_languages": null}, "macro.dbt_postgres.postgres__get_drop_index_sql": {"name": "postgres__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/adapters.sql", "original_file_path": "macros/adapters.sql", "unique_id": "macro.dbt_postgres.postgres__get_drop_index_sql", "macro_sql": "\n\n\n{%- macro postgres__get_drop_index_sql(relation, index_name) -%}\n drop index if exists \"{{ relation.schema }}\".\"{{ index_name }}\"\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2461686, "supported_languages": null}, "macro.dbt_postgres.postgres__listagg": {"name": "postgres__listagg", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt_postgres.postgres__listagg", "macro_sql": "{% macro postgres__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n (array_agg(\n {{ measure }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n ))[1:{{ limit_num }}],\n {{ delimiter_text }}\n )\n {%- else %}\n string_agg(\n {{ measure }},\n {{ delimiter_text }}\n {% if order_by_clause -%}\n {{ order_by_clause }}\n {%- endif %}\n )\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2472634, "supported_languages": null}, "macro.dbt_postgres.postgres__any_value": {"name": "postgres__any_value", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt_postgres.postgres__any_value", "macro_sql": "{% macro postgres__any_value(expression) -%}\n\n min({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2475743, "supported_languages": null}, "macro.dbt_postgres.postgres__last_day": {"name": "postgres__last_day", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt_postgres.postgres__last_day", "macro_sql": "{% macro postgres__last_day(date, datepart) -%}\n\n {%- if datepart == 'quarter' -%}\n -- postgres dateadd does not support quarter interval.\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd('month', '3', dbt.date_trunc(datepart, date))\n )}}\n as date)\n {%- else -%}\n {{dbt.default_last_day(date, datepart)}}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc", "macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.24854, "supported_languages": null}, "macro.dbt_postgres.postgres__dateadd": {"name": "postgres__dateadd", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt_postgres.postgres__dateadd", "macro_sql": "{% macro postgres__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n {{ from_date_or_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2489989, "supported_languages": null}, "macro.dbt_postgres.postgres__datediff": {"name": "postgres__datediff", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt_postgres.postgres__datediff", "macro_sql": "{% macro postgres__datediff(first_date, second_date, datepart) -%}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2531102, "supported_languages": null}, "macro.dbt_postgres.postgres__split_part": {"name": "postgres__split_part", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt_postgres.postgres__split_part", "macro_sql": "{% macro postgres__split_part(string_text, delimiter_text, part_number) %}\n\n {% if part_number >= 0 %}\n {{ dbt.default__split_part(string_text, delimiter_text, part_number) }}\n {% else %}\n {{ dbt._split_part_negative(string_text, delimiter_text, part_number) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__split_part", "macro.dbt._split_part_negative"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2539523, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_default_sql": {"name": "postgres__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_default_sql", "macro_sql": "{% macro postgres__get_incremental_default_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(get_incremental_delete_insert_sql(arg_dict)) %}\n {% else %}\n {% do return(get_incremental_append_sql(arg_dict)) %}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_delete_insert_sql", "macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2548027, "supported_languages": null}, "macro.dbt_postgres.postgres__get_incremental_microbatch_sql": {"name": "postgres__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/incremental_strategies.sql", "original_file_path": "macros/materializations/incremental_strategies.sql", "unique_id": "macro.dbt_postgres.postgres__get_incremental_microbatch_sql", "macro_sql": "{% macro postgres__get_incremental_microbatch_sql(arg_dict) %}\n\n {% if arg_dict[\"unique_key\"] %}\n {% do return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"dbt-postgres 'microbatch' requires a `unique_key` config\") }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_merge_sql", "macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2554715, "supported_languages": null}, "macro.dbt_postgres.postgres__snapshot_merge_sql": {"name": "postgres__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshot_merge.sql", "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n update {{ target }}\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }}::text = {{ target }}.{{ columns.dbt_scd_id }}::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n {% if config.get(\"dbt_valid_to_current\") %}\n and ({{ target }}.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }} or {{ target }}.{{ columns.dbt_valid_to }} is null);\n {% else %}\n and {{ target }}.{{ columns.dbt_valid_to }} is null;\n {% endif %}\n\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2576733, "supported_languages": null}, "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql": {"name": "postgres__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt_postgres.postgres__formatted_scalar_function_args_sql", "macro_sql": "{% macro postgres__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {% set default_value = arg.get('default_value', none) %}\n {% if default_value != none %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type ~ ' DEFAULT ' ~ default_value) -%}\n {% else %}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {% endif %}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.259124, "supported_languages": null}, "macro.dbt_postgres.postgres__describe_materialized_view": {"name": "postgres__describe_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/describe.sql", "original_file_path": "macros/relations/materialized_view/describe.sql", "unique_id": "macro.dbt_postgres.postgres__describe_materialized_view", "macro_sql": "{% macro postgres__describe_materialized_view(relation) %}\n -- for now just get the indexes, we don't need the name or the query yet\n {% set _indexes = run_query(get_show_indexes_sql(relation)) %}\n {% do return({'indexes': _indexes}) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.259738, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_materialized_view": {"name": "postgres__drop_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_materialized_view", "macro_sql": "{% macro postgres__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.260068, "supported_languages": null}, "macro.dbt_postgres.postgres__refresh_materialized_view": {"name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt_postgres.postgres__refresh_materialized_view", "macro_sql": "{% macro postgres__refresh_materialized_view(relation) %}\n refresh materialized view {{ relation }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2603562, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": {"name": "postgres__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_materialized_view_sql", "macro_sql": "{% macro postgres__get_rename_materialized_view_sql(relation, new_name) %}\n alter materialized view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.260709, "supported_languages": null}, "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": {"name": "postgres__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_create_materialized_view_as_sql(relation, sql) %}\n create materialized view if not exists {{ relation }} as {{ sql }};\n\n {% for _index_dict in config.get('indexes', []) -%}\n {{- get_create_index_sql(relation, _index_dict) -}}{{ ';' if not loop.last else \"\" }}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2615561, "supported_languages": null}, "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": {"name": "postgres__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql", "macro_sql": "{% macro postgres__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n\n -- apply a full refresh immediately if needed\n {% if configuration_changes.requires_full_refresh %}\n\n {{ get_replace_sql(existing_relation, relation, sql) }}\n\n -- otherwise apply individual changes as needed\n {% else %}\n\n {{ postgres__update_indexes_on_materialized_view(relation, configuration_changes.indexes) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_sql", "macro.dbt_postgres.postgres__update_indexes_on_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2626405, "supported_languages": null}, "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": {"name": "postgres__update_indexes_on_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__update_indexes_on_materialized_view", "macro_sql": "\n\n\n{%- macro postgres__update_indexes_on_materialized_view(relation, index_changes) -%}\n {{- log(\"Applying UPDATE INDEXES to: \" ~ relation) -}}\n\n {%- for _index_change in index_changes -%}\n {%- set _index = _index_change.context -%}\n\n {%- if _index_change.action == \"drop\" -%}\n\n {{ postgres__get_drop_index_sql(relation, _index.name) }}\n\n {%- elif _index_change.action == \"create\" -%}\n\n {{ postgres__get_create_index_sql(relation, _index.as_node_config) }}\n\n {%- endif -%}\n\t{{ ';' if not loop.last else \"\" }}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql", "macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.263713, "supported_languages": null}, "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": {"name": "postgres__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes", "macro_sql": "{% macro postgres__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {% set _existing_materialized_view = postgres__describe_materialized_view(existing_relation) %}\n {% set _configuration_changes = existing_relation.get_materialized_view_config_change_collection(_existing_materialized_view, new_config.model) %}\n {% do return(_configuration_changes) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__describe_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2643332, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_view_sql": {"name": "postgres__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_view_sql", "macro_sql": "{% macro postgres__get_replace_view_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2653794, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_view": {"name": "postgres__drop_view", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_view", "macro_sql": "{% macro postgres__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.265668, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_view_sql": {"name": "postgres__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_view_sql", "macro_sql": "{% macro postgres__get_rename_view_sql(relation, new_name) %}\n alter view {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2660415, "supported_languages": null}, "macro.dbt_postgres.postgres__get_replace_table_sql": {"name": "postgres__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt_postgres.postgres__get_replace_table_sql", "macro_sql": "{% macro postgres__get_replace_table_sql(relation, sql) -%}\n\n {%- set sql_header = config.get('sql_header', none) -%}\n {{ sql_header if sql_header is not none }}\n\n create or replace table {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2673886, "supported_languages": null}, "macro.dbt_postgres.postgres__drop_table": {"name": "postgres__drop_table", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt_postgres.postgres__drop_table", "macro_sql": "{% macro postgres__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.267688, "supported_languages": null}, "macro.dbt_postgres.postgres__get_rename_table_sql": {"name": "postgres__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt_postgres", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt_postgres.postgres__get_rename_table_sql", "macro_sql": "{% macro postgres__get_rename_table_sql(relation, new_name) %}\n alter table {{ relation }} rename to {{ new_name }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.268068, "supported_languages": null}, "macro.dbt.type_string": {"name": "type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_string", "macro_sql": "\n\n{%- macro type_string() -%}\n {{ return(adapter.dispatch('type_string', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2693982, "supported_languages": null}, "macro.dbt.default__type_string": {"name": "default__type_string", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_string", "macro_sql": "{% macro default__type_string() %}\n {{ return(api.Column.translate_type(\"string\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.269708, "supported_languages": null}, "macro.dbt.type_timestamp": {"name": "type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_timestamp", "macro_sql": "\n\n{%- macro type_timestamp() -%}\n {{ return(adapter.dispatch('type_timestamp', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2700675, "supported_languages": null}, "macro.dbt.default__type_timestamp": {"name": "default__type_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_timestamp", "macro_sql": "{% macro default__type_timestamp() %}\n {{ return(api.Column.translate_type(\"timestamp\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2703702, "supported_languages": null}, "macro.dbt.type_float": {"name": "type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_float", "macro_sql": "\n\n{%- macro type_float() -%}\n {{ return(adapter.dispatch('type_float', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_float"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2706885, "supported_languages": null}, "macro.dbt.default__type_float": {"name": "default__type_float", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_float", "macro_sql": "{% macro default__type_float() %}\n {{ return(api.Column.translate_type(\"float\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2710154, "supported_languages": null}, "macro.dbt.type_numeric": {"name": "type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_numeric", "macro_sql": "\n\n{%- macro type_numeric() -%}\n {{ return(adapter.dispatch('type_numeric', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2713387, "supported_languages": null}, "macro.dbt.default__type_numeric": {"name": "default__type_numeric", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_numeric", "macro_sql": "{% macro default__type_numeric() %}\n {{ return(api.Column.numeric_type(\"numeric\", 28, 6)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.271687, "supported_languages": null}, "macro.dbt.type_bigint": {"name": "type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_bigint", "macro_sql": "\n\n{%- macro type_bigint() -%}\n {{ return(adapter.dispatch('type_bigint', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_bigint"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.272035, "supported_languages": null}, "macro.dbt.default__type_bigint": {"name": "default__type_bigint", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_bigint", "macro_sql": "{% macro default__type_bigint() %}\n {{ return(api.Column.translate_type(\"bigint\")) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2723427, "supported_languages": null}, "macro.dbt.type_int": {"name": "type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_int", "macro_sql": "\n\n{%- macro type_int() -%}\n {{ return(adapter.dispatch('type_int', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_int"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2726667, "supported_languages": null}, "macro.dbt.default__type_int": {"name": "default__type_int", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_int", "macro_sql": "{%- macro default__type_int() -%}\n {{ return(api.Column.translate_type(\"integer\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2729874, "supported_languages": null}, "macro.dbt.type_boolean": {"name": "type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.type_boolean", "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__type_boolean"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.273305, "supported_languages": null}, "macro.dbt.default__type_boolean": {"name": "default__type_boolean", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/data_types.sql", "original_file_path": "macros/utils/data_types.sql", "unique_id": "macro.dbt.default__type_boolean", "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2737012, "supported_languages": null}, "macro.dbt.string_literal": {"name": "string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.string_literal", "macro_sql": "{%- macro string_literal(value) -%}\n {{ return(adapter.dispatch('string_literal', 'dbt') (value)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2742238, "supported_languages": null}, "macro.dbt.default__string_literal": {"name": "default__string_literal", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/literal.sql", "original_file_path": "macros/utils/literal.sql", "unique_id": "macro.dbt.default__string_literal", "macro_sql": "{% macro default__string_literal(value) -%}\n '{{ value }}'\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2744544, "supported_languages": null}, "macro.dbt.safe_cast": {"name": "safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.safe_cast", "macro_sql": "{% macro safe_cast(field, type) %}\n {{ return(adapter.dispatch('safe_cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2750347, "supported_languages": null}, "macro.dbt.default__safe_cast": {"name": "default__safe_cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/safe_cast.sql", "original_file_path": "macros/utils/safe_cast.sql", "unique_id": "macro.dbt.default__safe_cast", "macro_sql": "{% macro default__safe_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2753255, "supported_languages": null}, "macro.dbt.cast": {"name": "cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.cast", "macro_sql": "{% macro cast(field, type) %}\n {{ return(adapter.dispatch('cast', 'dbt') (field, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2758818, "supported_languages": null}, "macro.dbt.default__cast": {"name": "default__cast", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast.sql", "original_file_path": "macros/utils/cast.sql", "unique_id": "macro.dbt.default__cast", "macro_sql": "{% macro default__cast(field, type) %}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2761574, "supported_languages": null}, "macro.dbt.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2770069, "supported_languages": null}, "macro.dbt.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2778094, "supported_languages": null}, "macro.dbt.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.278212, "supported_languages": null}, "macro.dbt.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/generate_series.sql", "original_file_path": "macros/utils/generate_series.sql", "unique_id": "macro.dbt.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2792447, "supported_languages": null}, "macro.dbt.date_trunc": {"name": "date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.date_trunc", "macro_sql": "{% macro date_trunc(datepart, date) -%}\n {{ return(adapter.dispatch('date_trunc', 'dbt') (datepart, date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2797983, "supported_languages": null}, "macro.dbt.default__date_trunc": {"name": "default__date_trunc", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_trunc.sql", "original_file_path": "macros/utils/date_trunc.sql", "unique_id": "macro.dbt.default__date_trunc", "macro_sql": "{% macro default__date_trunc(datepart, date) -%}\n date_trunc('{{datepart}}', {{date}})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2800934, "supported_languages": null}, "macro.dbt.listagg": {"name": "listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.listagg", "macro_sql": "{% macro listagg(measure, delimiter_text=\"','\", order_by_clause=none, limit_num=none) -%}\n {{ return(adapter.dispatch('listagg', 'dbt') (measure, delimiter_text, order_by_clause, limit_num)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__listagg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2809536, "supported_languages": null}, "macro.dbt.default__listagg": {"name": "default__listagg", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/listagg.sql", "original_file_path": "macros/utils/listagg.sql", "unique_id": "macro.dbt.default__listagg", "macro_sql": "{% macro default__listagg(measure, delimiter_text, order_by_clause, limit_num) -%}\n\n {% if limit_num -%}\n array_to_string(\n array_slice(\n array_agg(\n {{ measure }}\n ){% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n ,0\n ,{{ limit_num }}\n ),\n {{ delimiter_text }}\n )\n {%- else %}\n listagg(\n {{ measure }},\n {{ delimiter_text }}\n )\n {% if order_by_clause -%}\n within group ({{ order_by_clause }})\n {%- endif %}\n {%- endif %}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2817628, "supported_languages": null}, "macro.dbt.replace": {"name": "replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.replace", "macro_sql": "{% macro replace(field, old_chars, new_chars) -%}\n {{ return(adapter.dispatch('replace', 'dbt') (field, old_chars, new_chars)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__replace"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2823813, "supported_languages": null}, "macro.dbt.default__replace": {"name": "default__replace", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/replace.sql", "original_file_path": "macros/utils/replace.sql", "unique_id": "macro.dbt.default__replace", "macro_sql": "{% macro default__replace(field, old_chars, new_chars) %}\n\n replace(\n {{ field }},\n {{ old_chars }},\n {{ new_chars }}\n )\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.282845, "supported_languages": null}, "macro.dbt.any_value": {"name": "any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.any_value", "macro_sql": "{% macro any_value(expression) -%}\n {{ return(adapter.dispatch('any_value', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__any_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.283338, "supported_languages": null}, "macro.dbt.default__any_value": {"name": "default__any_value", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/any_value.sql", "original_file_path": "macros/utils/any_value.sql", "unique_id": "macro.dbt.default__any_value", "macro_sql": "{% macro default__any_value(expression) -%}\n\n any_value({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.283558, "supported_languages": null}, "macro.dbt.except": {"name": "except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.except", "macro_sql": "{% macro except() %}\n {{ return(adapter.dispatch('except', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2840273, "supported_languages": null}, "macro.dbt.default__except": {"name": "default__except", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/except.sql", "original_file_path": "macros/utils/except.sql", "unique_id": "macro.dbt.default__except", "macro_sql": "{% macro default__except() %}\n\n except\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2841961, "supported_languages": null}, "macro.dbt.last_day": {"name": "last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.last_day", "macro_sql": "{% macro last_day(date, datepart) %}\n {{ return(adapter.dispatch('last_day', 'dbt') (date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2847826, "supported_languages": null}, "macro.dbt.default_last_day": {"name": "default_last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default_last_day", "macro_sql": "\n\n{%- macro default_last_day(date, datepart) -%}\n cast(\n {{dbt.dateadd('day', '-1',\n dbt.dateadd(datepart, '1', dbt.date_trunc(datepart, date))\n )}}\n as date)\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.date_trunc"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2853866, "supported_languages": null}, "macro.dbt.default__last_day": {"name": "default__last_day", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/last_day.sql", "original_file_path": "macros/utils/last_day.sql", "unique_id": "macro.dbt.default__last_day", "macro_sql": "{% macro default__last_day(date, datepart) -%}\n {{dbt.default_last_day(date, datepart)}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default_last_day"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.28569, "supported_languages": null}, "macro.dbt.date": {"name": "date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.date", "macro_sql": "{% macro date(year, month, day) %}\n {{ return(adapter.dispatch('date', 'dbt') (year, month, day)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.286342, "supported_languages": null}, "macro.dbt.default__date": {"name": "default__date", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date.sql", "original_file_path": "macros/utils/date.sql", "unique_id": "macro.dbt.default__date", "macro_sql": "{% macro default__date(year, month, day) -%}\n {%- set dt = modules.datetime.date(year, month, day) -%}\n {%- set iso_8601_formatted_date = dt.strftime('%Y-%m-%d') -%}\n to_date('{{ iso_8601_formatted_date }}', 'YYYY-MM-DD')\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2869308, "supported_languages": null}, "macro.dbt.array_concat": {"name": "array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.array_concat", "macro_sql": "{% macro array_concat(array_1, array_2) -%}\n {{ return(adapter.dispatch('array_concat', 'dbt')(array_1, array_2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.28746, "supported_languages": null}, "macro.dbt.default__array_concat": {"name": "default__array_concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_concat.sql", "original_file_path": "macros/utils/array_concat.sql", "unique_id": "macro.dbt.default__array_concat", "macro_sql": "{% macro default__array_concat(array_1, array_2) -%}\n array_cat({{ array_1 }}, {{ array_2 }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2877293, "supported_languages": null}, "macro.dbt.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2886636, "supported_languages": null}, "macro.dbt.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2898831, "supported_languages": null}, "macro.dbt.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2904549, "supported_languages": null}, "macro.dbt.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/date_spine.sql", "original_file_path": "macros/utils/date_spine.sql", "unique_id": "macro.dbt.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n {# call as follows:\n\n date_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n ) #}\n\n\n with rawdata as (\n\n {{dbt.generate_series(\n dbt.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by 1) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.generate_series", "macro.dbt.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.291192, "supported_languages": null}, "macro.dbt.dateadd": {"name": "dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.dateadd", "macro_sql": "{% macro dateadd(datepart, interval, from_date_or_timestamp) %}\n {{ return(adapter.dispatch('dateadd', 'dbt')(datepart, interval, from_date_or_timestamp)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2918093, "supported_languages": null}, "macro.dbt.default__dateadd": {"name": "default__dateadd", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/dateadd.sql", "original_file_path": "macros/utils/dateadd.sql", "unique_id": "macro.dbt.default__dateadd", "macro_sql": "{% macro default__dateadd(datepart, interval, from_date_or_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_date_or_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2922027, "supported_languages": null}, "macro.dbt.cast_bool_to_text": {"name": "cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.cast_bool_to_text", "macro_sql": "{% macro cast_bool_to_text(field) %}\n {{ adapter.dispatch('cast_bool_to_text', 'dbt') (field) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2926843, "supported_languages": null}, "macro.dbt.default__cast_bool_to_text": {"name": "default__cast_bool_to_text", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/cast_bool_to_text.sql", "original_file_path": "macros/utils/cast_bool_to_text.sql", "unique_id": "macro.dbt.default__cast_bool_to_text", "macro_sql": "{% macro default__cast_bool_to_text(field) %}\n cast({{ field }} as {{ api.Column.translate_type('string') }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2930374, "supported_languages": null}, "macro.dbt.array_append": {"name": "array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.array_append", "macro_sql": "{% macro array_append(array, new_element) -%}\n {{ return(adapter.dispatch('array_append', 'dbt')(array, new_element)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_append"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.293583, "supported_languages": null}, "macro.dbt.default__array_append": {"name": "default__array_append", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_append.sql", "original_file_path": "macros/utils/array_append.sql", "unique_id": "macro.dbt.default__array_append", "macro_sql": "{% macro default__array_append(array, new_element) -%}\n array_append({{ array }}, {{ new_element }})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2938716, "supported_languages": null}, "macro.dbt.concat": {"name": "concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.concat", "macro_sql": "{% macro concat(fields) -%}\n {{ return(adapter.dispatch('concat', 'dbt')(fields)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2943552, "supported_languages": null}, "macro.dbt.default__concat": {"name": "default__concat", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/concat.sql", "original_file_path": "macros/utils/concat.sql", "unique_id": "macro.dbt.default__concat", "macro_sql": "{% macro default__concat(fields) -%}\n {{ fields|join(' || ') }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2946093, "supported_languages": null}, "macro.dbt.bool_or": {"name": "bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.bool_or", "macro_sql": "{% macro bool_or(expression) -%}\n {{ return(adapter.dispatch('bool_or', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__bool_or"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.295111, "supported_languages": null}, "macro.dbt.default__bool_or": {"name": "default__bool_or", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/bool_or.sql", "original_file_path": "macros/utils/bool_or.sql", "unique_id": "macro.dbt.default__bool_or", "macro_sql": "{% macro default__bool_or(expression) -%}\n\n bool_or({{ expression }})\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.295328, "supported_languages": null}, "macro.dbt.hash": {"name": "hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.hash", "macro_sql": "{% macro hash(field) -%}\n {{ return(adapter.dispatch('hash', 'dbt') (field)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__hash"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.295809, "supported_languages": null}, "macro.dbt.default__hash": {"name": "default__hash", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/hash.sql", "original_file_path": "macros/utils/hash.sql", "unique_id": "macro.dbt.default__hash", "macro_sql": "{% macro default__hash(field) -%}\n md5(cast({{ field }} as {{ api.Column.translate_type('string') }}))\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2961638, "supported_languages": null}, "macro.dbt.array_construct": {"name": "array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.array_construct", "macro_sql": "{% macro array_construct(inputs=[], data_type=api.Column.translate_type('integer')) -%}\n {{ return(adapter.dispatch('array_construct', 'dbt')(inputs, data_type)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__array_construct"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2968943, "supported_languages": null}, "macro.dbt.default__array_construct": {"name": "default__array_construct", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/array_construct.sql", "original_file_path": "macros/utils/array_construct.sql", "unique_id": "macro.dbt.default__array_construct", "macro_sql": "{% macro default__array_construct(inputs, data_type) -%}\n {% if inputs|length > 0 %}\n array[ {{ inputs|join(' , ') }} ]\n {% else %}\n array[]::{{data_type}}[]\n {% endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.297376, "supported_languages": null}, "macro.dbt.right": {"name": "right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.right", "macro_sql": "{% macro right(string_text, length_expression) -%}\n {{ return(adapter.dispatch('right', 'dbt') (string_text, length_expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__right"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.297939, "supported_languages": null}, "macro.dbt.default__right": {"name": "default__right", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/right.sql", "original_file_path": "macros/utils/right.sql", "unique_id": "macro.dbt.default__right", "macro_sql": "{% macro default__right(string_text, length_expression) %}\n\n right(\n {{ string_text }},\n {{ length_expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2983303, "supported_languages": null}, "macro.dbt.escape_single_quotes": {"name": "escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.escape_single_quotes", "macro_sql": "{% macro escape_single_quotes(expression) %}\n {{ return(adapter.dispatch('escape_single_quotes', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__escape_single_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2988703, "supported_languages": null}, "macro.dbt.default__escape_single_quotes": {"name": "default__escape_single_quotes", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/escape_single_quotes.sql", "original_file_path": "macros/utils/escape_single_quotes.sql", "unique_id": "macro.dbt.default__escape_single_quotes", "macro_sql": "{% macro default__escape_single_quotes(expression) -%}\n{{ expression | replace(\"'\",\"''\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2991602, "supported_languages": null}, "macro.dbt.datediff": {"name": "datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.datediff", "macro_sql": "{% macro datediff(first_date, second_date, datepart) %}\n {{ return(adapter.dispatch('datediff', 'dbt')(first_date, second_date, datepart)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.2997587, "supported_languages": null}, "macro.dbt.default__datediff": {"name": "default__datediff", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/datediff.sql", "original_file_path": "macros/utils/datediff.sql", "unique_id": "macro.dbt.default__datediff", "macro_sql": "{% macro default__datediff(first_date, second_date, datepart) -%}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3001242, "supported_languages": null}, "macro.dbt.intersect": {"name": "intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.intersect", "macro_sql": "{% macro intersect() %}\n {{ return(adapter.dispatch('intersect', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__intersect"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3005662, "supported_languages": null}, "macro.dbt.default__intersect": {"name": "default__intersect", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/intersect.sql", "original_file_path": "macros/utils/intersect.sql", "unique_id": "macro.dbt.default__intersect", "macro_sql": "{% macro default__intersect() %}\n\n intersect\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3007286, "supported_languages": null}, "macro.dbt.equals": {"name": "equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.equals", "macro_sql": "{% macro equals(expr1, expr2) %}\n {{ return(adapter.dispatch('equals', 'dbt') (expr1, expr2)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.301368, "supported_languages": null}, "macro.dbt.default__equals": {"name": "default__equals", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/equals.sql", "original_file_path": "macros/utils/equals.sql", "unique_id": "macro.dbt.default__equals", "macro_sql": "{% macro default__equals(expr1, expr2) -%}\n{%- if adapter.behavior.enable_truthy_nulls_equals_macro.no_warn %}\n case when (({{ expr1 }} = {{ expr2 }}) or ({{ expr1 }} is null and {{ expr2 }} is null))\n then 0\n else 1\n end = 0\n{%- else -%}\n ({{ expr1 }} = {{ expr2 }})\n{%- endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3019824, "supported_languages": null}, "macro.dbt.split_part": {"name": "split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.split_part", "macro_sql": "{% macro split_part(string_text, delimiter_text, part_number) %}\n {{ return(adapter.dispatch('split_part', 'dbt') (string_text, delimiter_text, part_number)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.302671, "supported_languages": null}, "macro.dbt.default__split_part": {"name": "default__split_part", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt.default__split_part", "macro_sql": "{% macro default__split_part(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3030279, "supported_languages": null}, "macro.dbt._split_part_negative": {"name": "_split_part_negative", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/split_part.sql", "original_file_path": "macros/utils/split_part.sql", "unique_id": "macro.dbt._split_part_negative", "macro_sql": "{% macro _split_part_negative(string_text, delimiter_text, part_number) %}\n\n split_part(\n {{ string_text }},\n {{ delimiter_text }},\n length({{ string_text }})\n - length(\n replace({{ string_text }}, {{ delimiter_text }}, '')\n ) + 2 + {{ part_number }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3034706, "supported_languages": null}, "macro.dbt.length": {"name": "length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.length", "macro_sql": "{% macro length(expression) -%}\n {{ return(adapter.dispatch('length', 'dbt') (expression)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__length"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3039818, "supported_languages": null}, "macro.dbt.default__length": {"name": "default__length", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/length.sql", "original_file_path": "macros/utils/length.sql", "unique_id": "macro.dbt.default__length", "macro_sql": "{% macro default__length(expression) %}\n\n length(\n {{ expression }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3042033, "supported_languages": null}, "macro.dbt.position": {"name": "position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.position", "macro_sql": "{% macro position(substring_text, string_text) -%}\n {{ return(adapter.dispatch('position', 'dbt') (substring_text, string_text)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__position"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3047469, "supported_languages": null}, "macro.dbt.default__position": {"name": "default__position", "resource_type": "macro", "package_name": "dbt", "path": "macros/utils/position.sql", "original_file_path": "macros/utils/position.sql", "unique_id": "macro.dbt.default__position", "macro_sql": "{% macro default__position(substring_text, string_text) %}\n\n position(\n {{ substring_text }} in {{ string_text }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.305062, "supported_languages": null}, "macro.dbt.default__test_unique": {"name": "default__test_unique", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/unique.sql", "original_file_path": "macros/generic_test_sql/unique.sql", "unique_id": "macro.dbt.default__test_unique", "macro_sql": "{% macro default__test_unique(model, column_name) %}\n\nselect\n {{ column_name }} as unique_field,\n count(*) as n_records\n\nfrom {{ model }}\nwhere {{ column_name }} is not null\ngroup by {{ column_name }}\nhaving count(*) > 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3055143, "supported_languages": null}, "macro.dbt.default__test_not_null": {"name": "default__test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/not_null.sql", "original_file_path": "macros/generic_test_sql/not_null.sql", "unique_id": "macro.dbt.default__test_not_null", "macro_sql": "{% macro default__test_not_null(model, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else column_name %}\n\nselect {{ column_list }}\nfrom {{ model }}\nwhere {{ column_name }} is null\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3062303, "supported_languages": null}, "macro.dbt.default__test_relationships": {"name": "default__test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/relationships.sql", "original_file_path": "macros/generic_test_sql/relationships.sql", "unique_id": "macro.dbt.default__test_relationships", "macro_sql": "{% macro default__test_relationships(model, column_name, to, field) %}\n\nwith child as (\n select {{ column_name }} as from_field\n from {{ model }}\n where {{ column_name }} is not null\n),\n\nparent as (\n select {{ field }} as to_field\n from {{ to }}\n)\n\nselect\n from_field\n\nfrom child\nleft join parent\n on child.from_field = parent.to_field\n\nwhere parent.to_field is null\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3067884, "supported_languages": null}, "macro.dbt.default__test_accepted_values": {"name": "default__test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "macros/generic_test_sql/accepted_values.sql", "original_file_path": "macros/generic_test_sql/accepted_values.sql", "unique_id": "macro.dbt.default__test_accepted_values", "macro_sql": "{% macro default__test_accepted_values(model, column_name, values, quote=True) %}\n\nwith all_values as (\n\n select\n {{ column_name }} as value_field,\n count(*) as n_records\n\n from {{ model }}\n group by {{ column_name }}\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n)\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3078015, "supported_languages": null}, "macro.dbt.copy_grants": {"name": "copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.copy_grants", "macro_sql": "{% macro copy_grants() %}\n {{ return(adapter.dispatch('copy_grants', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3098986, "supported_languages": null}, "macro.dbt.default__copy_grants": {"name": "default__copy_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__copy_grants", "macro_sql": "{% macro default__copy_grants() %}\n {{ return(True) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3101454, "supported_languages": null}, "macro.dbt.support_multiple_grantees_per_dcl_statement": {"name": "support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.support_multiple_grantees_per_dcl_statement", "macro_sql": "{% macro support_multiple_grantees_per_dcl_statement() %}\n {{ return(adapter.dispatch('support_multiple_grantees_per_dcl_statement', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.310477, "supported_languages": null}, "macro.dbt.default__support_multiple_grantees_per_dcl_statement": {"name": "default__support_multiple_grantees_per_dcl_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__support_multiple_grantees_per_dcl_statement", "macro_sql": "\n\n{%- macro default__support_multiple_grantees_per_dcl_statement() -%}\n {{ return(True) }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3107066, "supported_languages": null}, "macro.dbt.should_revoke": {"name": "should_revoke", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.should_revoke", "macro_sql": "{% macro should_revoke(existing_relation, full_refresh_mode=True) %}\n\n {% if not existing_relation %}\n {#-- The table doesn't already exist, so no grants to copy over --#}\n {{ return(False) }}\n {% elif full_refresh_mode %}\n {#-- The object is being REPLACED -- whether grants are copied over depends on the value of user config --#}\n {{ return(copy_grants()) }}\n {% else %}\n {#-- The table is being merged/upserted/inserted -- grants will be carried over --#}\n {{ return(True) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.copy_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3114104, "supported_languages": null}, "macro.dbt.get_show_grant_sql": {"name": "get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_show_grant_sql", "macro_sql": "{% macro get_show_grant_sql(relation) %}\n {{ return(adapter.dispatch(\"get_show_grant_sql\", \"dbt\")(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3117821, "supported_languages": null}, "macro.dbt.default__get_show_grant_sql": {"name": "default__get_show_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_show_grant_sql", "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3120563, "supported_languages": null}, "macro.dbt.get_grant_sql": {"name": "get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_grant_sql", "macro_sql": "{% macro get_grant_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_grant_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_grant_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3124986, "supported_languages": null}, "macro.dbt.default__get_grant_sql": {"name": "default__get_grant_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_grant_sql", "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation.render() }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3129356, "supported_languages": null}, "macro.dbt.get_revoke_sql": {"name": "get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_revoke_sql", "macro_sql": "{% macro get_revoke_sql(relation, privilege, grantees) %}\n {{ return(adapter.dispatch('get_revoke_sql', 'dbt')(relation, privilege, grantees)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_revoke_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3133888, "supported_languages": null}, "macro.dbt.default__get_revoke_sql": {"name": "default__get_revoke_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_revoke_sql", "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n {%- set quoted_grantees = [] -%}\n {%- for grantee in grantees -%}\n {%- do quoted_grantees.append(adapter.quote(grantee)) -%}\n {%- endfor -%}\n revoke {{ privilege }} on {{ relation.render() }} from {{ quoted_grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3141549, "supported_languages": null}, "macro.dbt.get_dcl_statement_list": {"name": "get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.get_dcl_statement_list", "macro_sql": "{% macro get_dcl_statement_list(relation, grant_config, get_dcl_macro) %}\n {{ return(adapter.dispatch('get_dcl_statement_list', 'dbt')(relation, grant_config, get_dcl_macro)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_dcl_statement_list"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3152528, "supported_languages": null}, "macro.dbt.default__get_dcl_statement_list": {"name": "default__get_dcl_statement_list", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__get_dcl_statement_list", "macro_sql": "\n\n{%- macro default__get_dcl_statement_list(relation, grant_config, get_dcl_macro) -%}\n {#\n -- Unpack grant_config into specific privileges and the set of users who need them granted/revoked.\n -- Depending on whether this database supports multiple grantees per statement, pass in the list of\n -- all grantees per privilege, or (if not) template one statement per privilege-grantee pair.\n -- `get_dcl_macro` will be either `get_grant_sql` or `get_revoke_sql`\n #}\n {%- set dcl_statements = [] -%}\n {%- for privilege, grantees in grant_config.items() %}\n {%- if support_multiple_grantees_per_dcl_statement() and grantees -%}\n {%- set dcl = get_dcl_macro(relation, privilege, grantees) -%}\n {%- do dcl_statements.append(dcl) -%}\n {%- else -%}\n {%- for grantee in grantees -%}\n {% set dcl = get_dcl_macro(relation, privilege, [grantee]) %}\n {%- do dcl_statements.append(dcl) -%}\n {% endfor -%}\n {%- endif -%}\n {%- endfor -%}\n {{ return(dcl_statements) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.support_multiple_grantees_per_dcl_statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.316591, "supported_languages": null}, "macro.dbt.call_dcl_statements": {"name": "call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.call_dcl_statements", "macro_sql": "{% macro call_dcl_statements(dcl_statement_list) %}\n {{ return(adapter.dispatch(\"call_dcl_statements\", \"dbt\")(dcl_statement_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3169923, "supported_languages": null}, "macro.dbt.default__call_dcl_statements": {"name": "default__call_dcl_statements", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__call_dcl_statements", "macro_sql": "{% macro default__call_dcl_statements(dcl_statement_list) %}\n {#\n -- By default, supply all grant + revoke statements in a single semicolon-separated block,\n -- so that they're all processed together.\n\n -- Some databases do not support this. Those adapters will need to override this macro\n -- to run each statement individually.\n #}\n {% call statement('grants') %}\n {% for dcl_statement in dcl_statement_list %}\n {{ dcl_statement }};\n {% endfor %}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3174808, "supported_languages": null}, "macro.dbt.apply_grants": {"name": "apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.apply_grants", "macro_sql": "{% macro apply_grants(relation, grant_config, should_revoke) %}\n {{ return(adapter.dispatch(\"apply_grants\", \"dbt\")(relation, grant_config, should_revoke)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3179562, "supported_languages": null}, "macro.dbt.default__apply_grants": {"name": "default__apply_grants", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/apply_grants.sql", "original_file_path": "macros/adapters/apply_grants.sql", "unique_id": "macro.dbt.default__apply_grants", "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation.render() ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.get_show_grant_sql", "macro.dbt.get_dcl_statement_list", "macro.dbt.call_dcl_statements"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3202512, "supported_languages": null}, "macro.dbt.get_create_index_sql": {"name": "get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_create_index_sql", "macro_sql": "{% macro get_create_index_sql(relation, index_dict) -%}\n {{ return(adapter.dispatch('get_create_index_sql', 'dbt')(relation, index_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.321211, "supported_languages": null}, "macro.dbt.default__get_create_index_sql": {"name": "default__get_create_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_create_index_sql", "macro_sql": "{% macro default__get_create_index_sql(relation, index_dict) -%}\n {% do return(None) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3215053, "supported_languages": null}, "macro.dbt.create_indexes": {"name": "create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.create_indexes", "macro_sql": "{% macro create_indexes(relation) -%}\n {{ adapter.dispatch('create_indexes', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.321846, "supported_languages": null}, "macro.dbt.default__create_indexes": {"name": "default__create_indexes", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__create_indexes", "macro_sql": "{% macro default__create_indexes(relation) -%}\n {%- set _indexes = config.get('indexes', default=[]) -%}\n\n {% for _index_dict in _indexes %}\n {% set create_index_sql = get_create_index_sql(relation, _index_dict) %}\n {% if create_index_sql %}\n {% do run_query(create_index_sql) %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_create_index_sql", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.322632, "supported_languages": null}, "macro.dbt.get_drop_index_sql": {"name": "get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_drop_index_sql", "macro_sql": "{% macro get_drop_index_sql(relation, index_name) -%}\n {{ adapter.dispatch('get_drop_index_sql', 'dbt')(relation, index_name) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_drop_index_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3230348, "supported_languages": null}, "macro.dbt.default__get_drop_index_sql": {"name": "default__get_drop_index_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_drop_index_sql", "macro_sql": "{% macro default__get_drop_index_sql(relation, index_name) -%}\n {{ exceptions.raise_compiler_error(\"`get_drop_index_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.323326, "supported_languages": null}, "macro.dbt.get_show_indexes_sql": {"name": "get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.get_show_indexes_sql", "macro_sql": "{% macro get_show_indexes_sql(relation) -%}\n {{ adapter.dispatch('get_show_indexes_sql', 'dbt')(relation) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_show_indexes_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3236446, "supported_languages": null}, "macro.dbt.default__get_show_indexes_sql": {"name": "default__get_show_indexes_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/indexes.sql", "original_file_path": "macros/adapters/indexes.sql", "unique_id": "macro.dbt.default__get_show_indexes_sql", "macro_sql": "{% macro default__get_show_indexes_sql(relation) -%}\n {{ exceptions.raise_compiler_error(\"`get_show_indexes_sql has not been implemented for this adapter.\") }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3239334, "supported_languages": null}, "macro.dbt.get_columns_in_relation": {"name": "get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_relation", "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3261461, "supported_languages": null}, "macro.dbt.default__get_columns_in_relation": {"name": "default__get_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_relation", "macro_sql": "{% macro default__get_columns_in_relation(relation) -%}\n {{ exceptions.raise_not_implemented(\n 'get_columns_in_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3264742, "supported_languages": null}, "macro.dbt.sql_convert_columns_in_relation": {"name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.sql_convert_columns_in_relation", "macro_sql": "{% macro sql_convert_columns_in_relation(table) -%}\n {% set columns = [] %}\n {% for row in table %}\n {% do columns.append(api.Column(*row)) %}\n {% endfor %}\n {{ return(columns) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3272352, "supported_languages": null}, "macro.dbt.get_list_of_column_names": {"name": "get_list_of_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_list_of_column_names", "macro_sql": "\n\n{%- macro get_list_of_column_names(columns) -%}\n {% set col_names = [] %}\n {% for col in columns %}\n {% do col_names.append(col.name) %}\n {% endfor %}\n {{ return(col_names) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3278134, "supported_languages": null}, "macro.dbt.get_empty_subquery_sql": {"name": "get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_subquery_sql", "macro_sql": "{% macro get_empty_subquery_sql(select_sql, select_sql_header=none) -%}\n {{ return(adapter.dispatch('get_empty_subquery_sql', 'dbt')(select_sql, select_sql_header)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3282778, "supported_languages": null}, "macro.dbt.default__get_empty_subquery_sql": {"name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_subquery_sql", "macro_sql": "{% macro default__get_empty_subquery_sql(select_sql, select_sql_header=none) %}\n {%- if select_sql_header is not none -%}\n {{ select_sql_header }}\n {%- endif -%}\n select * from (\n {{ select_sql }}\n ) as __dbt_sbq\n where false\n limit 0\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3286865, "supported_languages": null}, "macro.dbt.get_empty_schema_sql": {"name": "get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_empty_schema_sql", "macro_sql": "{% macro get_empty_schema_sql(columns) -%}\n {{ return(adapter.dispatch('get_empty_schema_sql', 'dbt')(columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_empty_schema_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3290732, "supported_languages": null}, "macro.dbt.default__get_empty_schema_sql": {"name": "default__get_empty_schema_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_empty_schema_sql", "macro_sql": "{% macro default__get_empty_schema_sql(columns) %}\n {%- set col_err = [] -%}\n {%- set col_naked_numeric = [] -%}\n select\n {% for i in columns %}\n {%- set col = columns[i] -%}\n {%- if col['data_type'] is not defined -%}\n {%- do col_err.append(col['name']) -%}\n {#-- If this column's type is just 'numeric' then it is missing precision/scale, raise a warning --#}\n {%- elif col['data_type'].strip().lower() in ('numeric', 'decimal', 'number') -%}\n {%- do col_naked_numeric.append(col['name']) -%}\n {%- endif -%}\n {% set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] %}\n {{ cast('null', col['data_type']) }} as {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n {%- if (col_err | length) > 0 -%}\n {{ exceptions.column_type_missing(column_names=col_err) }}\n {%- elif (col_naked_numeric | length) > 0 -%}\n {{ exceptions.warn(\"Detected columns with numeric type and unspecified precision/scale, this can lead to unintended rounding: \" ~ col_naked_numeric ~ \"`\") }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.331421, "supported_languages": null}, "macro.dbt.get_column_schema_from_query": {"name": "get_column_schema_from_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_column_schema_from_query", "macro_sql": "{% macro get_column_schema_from_query(select_sql, select_sql_header=none) -%}\n {% set columns = [] %}\n {# -- Using an 'empty subquery' here to get the same schema as the given select_sql statement, without necessitating a data scan.#}\n {% set sql = get_empty_subquery_sql(select_sql, select_sql_header) %}\n {% set column_schema = adapter.get_column_schema_from_query(sql) %}\n {{ return(column_schema) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.332138, "supported_languages": null}, "macro.dbt.get_columns_in_query": {"name": "get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.get_columns_in_query", "macro_sql": "{% macro get_columns_in_query(select_sql) -%}\n {{ return(adapter.dispatch('get_columns_in_query', 'dbt')(select_sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3324995, "supported_languages": null}, "macro.dbt.default__get_columns_in_query": {"name": "default__get_columns_in_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__get_columns_in_query", "macro_sql": "{% macro default__get_columns_in_query(select_sql) %}\n {% call statement('get_columns_in_query', fetch_result=True, auto_begin=False) -%}\n {{ get_empty_subquery_sql(select_sql) }}\n {% endcall %}\n {{ return(load_result('get_columns_in_query').table.columns | map(attribute='name') | list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_empty_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3332012, "supported_languages": null}, "macro.dbt.alter_column_type": {"name": "alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_column_type", "macro_sql": "{% macro alter_column_type(relation, column_name, new_column_type) -%}\n {{ return(adapter.dispatch('alter_column_type', 'dbt')(relation, column_name, new_column_type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3336465, "supported_languages": null}, "macro.dbt.default__alter_column_type": {"name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_column_type", "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation.render() }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation.render() }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation.render() }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation.render() }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3349512, "supported_languages": null}, "macro.dbt.alter_relation_add_remove_columns": {"name": "alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.alter_relation_add_remove_columns", "macro_sql": "{% macro alter_relation_add_remove_columns(relation, add_columns = none, remove_columns = none) -%}\n {{ return(adapter.dispatch('alter_relation_add_remove_columns', 'dbt')(relation, add_columns, remove_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__alter_relation_add_remove_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.335453, "supported_languages": null}, "macro.dbt.default__alter_relation_add_remove_columns": {"name": "default__alter_relation_add_remove_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/columns.sql", "original_file_path": "macros/adapters/columns.sql", "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation.render() }}\n\n {% for column in add_columns %}\n add column {{ column.quoted }} {{ column.expanded_data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.quoted }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.337062, "supported_languages": null}, "macro.dbt.current_timestamp": {"name": "current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp", "macro_sql": "{%- macro current_timestamp() -%}\n {{ adapter.dispatch('current_timestamp', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.337976, "supported_languages": null}, "macro.dbt.default__current_timestamp": {"name": "default__current_timestamp", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp", "macro_sql": "{% macro default__current_timestamp() -%}\n {{ exceptions.raise_not_implemented(\n 'current_timestamp macro not implemented for adapter ' + adapter.type()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3382819, "supported_languages": null}, "macro.dbt.snapshot_get_time": {"name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.snapshot_get_time", "macro_sql": "\n\n{%- macro snapshot_get_time() -%}\n {{ adapter.dispatch('snapshot_get_time', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_get_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3385854, "supported_languages": null}, "macro.dbt.default__snapshot_get_time": {"name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__snapshot_get_time", "macro_sql": "{% macro default__snapshot_get_time() %}\n {{ current_timestamp() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3388026, "supported_languages": null}, "macro.dbt.get_snapshot_get_time_data_type": {"name": "get_snapshot_get_time_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.get_snapshot_get_time_data_type", "macro_sql": "{% macro get_snapshot_get_time_data_type() %}\n {% set snapshot_time = adapter.dispatch('snapshot_get_time', 'dbt')() %}\n {% set time_data_type_sql = 'select ' ~ snapshot_time ~ ' as dbt_snapshot_time' %}\n {% set snapshot_time_column_schema = get_column_schema_from_query(time_data_type_sql) %}\n {% set time_data_type = snapshot_time_column_schema[0].dtype %}\n {{ return(time_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt_postgres.postgres__snapshot_get_time", "macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3397703, "supported_languages": null}, "macro.dbt.current_timestamp_backcompat": {"name": "current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_backcompat", "macro_sql": "{% macro current_timestamp_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3401387, "supported_languages": null}, "macro.dbt.default__current_timestamp_backcompat": {"name": "default__current_timestamp_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_backcompat", "macro_sql": "{% macro default__current_timestamp_backcompat() %}\n current_timestamp::timestamp\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3403041, "supported_languages": null}, "macro.dbt.current_timestamp_in_utc_backcompat": {"name": "current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.current_timestamp_in_utc_backcompat", "macro_sql": "{% macro current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_in_utc_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3406365, "supported_languages": null}, "macro.dbt.default__current_timestamp_in_utc_backcompat": {"name": "default__current_timestamp_in_utc_backcompat", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/timestamps.sql", "original_file_path": "macros/adapters/timestamps.sql", "unique_id": "macro.dbt.default__current_timestamp_in_utc_backcompat", "macro_sql": "{% macro default__current_timestamp_in_utc_backcompat() %}\n {{ return(adapter.dispatch('current_timestamp_backcompat', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.current_timestamp_backcompat", "macro.dbt_postgres.postgres__current_timestamp_backcompat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.340999, "supported_languages": null}, "macro.dbt.get_show_sql": {"name": "get_show_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_show_sql", "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header is not none -%}\n {{ sql_header }}\n {%- endif %}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3417387, "supported_languages": null}, "macro.dbt.get_limit_subquery_sql": {"name": "get_limit_subquery_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.get_limit_subquery_sql", "macro_sql": "\n{%- macro get_limit_subquery_sql(sql, limit) -%}\n {{ adapter.dispatch('get_limit_sql', 'dbt')(sql, limit) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_limit_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3421242, "supported_languages": null}, "macro.dbt.default__get_limit_sql": {"name": "default__get_limit_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/show.sql", "original_file_path": "macros/adapters/show.sql", "unique_id": "macro.dbt.default__get_limit_sql", "macro_sql": "{% macro default__get_limit_sql(sql, limit) %}\n {{ sql }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.342494, "supported_languages": null}, "macro.dbt.get_catalog_relations": {"name": "get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_relations", "macro_sql": "{% macro get_catalog_relations(information_schema, relations) -%}\n {{ return(adapter.dispatch('get_catalog_relations', 'dbt')(information_schema, relations)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3442016, "supported_languages": null}, "macro.dbt.default__get_catalog_relations": {"name": "default__get_catalog_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_relations", "macro_sql": "{% macro default__get_catalog_relations(information_schema, relations) -%}\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog_relations not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3447256, "supported_languages": null}, "macro.dbt.get_catalog": {"name": "get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog", "macro_sql": "{% macro get_catalog(information_schema, schemas) -%}\n {{ return(adapter.dispatch('get_catalog', 'dbt')(information_schema, schemas)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_catalog"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.345154, "supported_languages": null}, "macro.dbt.default__get_catalog": {"name": "default__get_catalog", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog", "macro_sql": "{% macro default__get_catalog(information_schema, schemas) -%}\n\n {% set typename = adapter.type() %}\n {% set msg -%}\n get_catalog not implemented for {{ typename }}\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3456588, "supported_languages": null}, "macro.dbt.information_schema_name": {"name": "information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.information_schema_name", "macro_sql": "{% macro information_schema_name(database) %}\n {{ return(adapter.dispatch('information_schema_name', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__information_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3460488, "supported_languages": null}, "macro.dbt.default__information_schema_name": {"name": "default__information_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__information_schema_name", "macro_sql": "{% macro default__information_schema_name(database) -%}\n {%- if database -%}\n {{ database }}.INFORMATION_SCHEMA\n {%- else -%}\n INFORMATION_SCHEMA\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.346368, "supported_languages": null}, "macro.dbt.list_schemas": {"name": "list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_schemas", "macro_sql": "{% macro list_schemas(database) -%}\n {{ return(adapter.dispatch('list_schemas', 'dbt')(database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.346721, "supported_languages": null}, "macro.dbt.default__list_schemas": {"name": "default__list_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_schemas", "macro_sql": "{% macro default__list_schemas(database) -%}\n {% set sql %}\n select distinct schema_name\n from {{ information_schema_name(database) }}.SCHEMATA\n where catalog_name ilike '{{ database }}'\n {% endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.information_schema_name", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.347234, "supported_languages": null}, "macro.dbt.check_schema_exists": {"name": "check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.check_schema_exists", "macro_sql": "{% macro check_schema_exists(information_schema, schema) -%}\n {{ return(adapter.dispatch('check_schema_exists', 'dbt')(information_schema, schema)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__check_schema_exists"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3476348, "supported_languages": null}, "macro.dbt.default__check_schema_exists": {"name": "default__check_schema_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__check_schema_exists", "macro_sql": "{% macro default__check_schema_exists(information_schema, schema) -%}\n {% set sql -%}\n select count(*)\n from {{ information_schema.replace(information_schema_view='SCHEMATA') }}\n where catalog_name='{{ information_schema.database }}'\n and schema_name='{{ schema }}'\n {%- endset %}\n {{ return(run_query(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3483746, "supported_languages": null}, "macro.dbt.list_relations_without_caching": {"name": "list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_relations_without_caching", "macro_sql": "{% macro list_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__list_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.348739, "supported_languages": null}, "macro.dbt.default__list_relations_without_caching": {"name": "default__list_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_relations_without_caching", "macro_sql": "{% macro default__list_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3490832, "supported_languages": null}, "macro.dbt.list_function_relations_without_caching": {"name": "list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.list_function_relations_without_caching", "macro_sql": "{% macro list_function_relations_without_caching(schema_relation) %}\n {{ return(adapter.dispatch('list_function_relations_without_caching', 'dbt')(schema_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__list_function_relations_without_caching"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3494554, "supported_languages": null}, "macro.dbt.default__list_function_relations_without_caching": {"name": "default__list_function_relations_without_caching", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__list_function_relations_without_caching", "macro_sql": "{% macro default__list_function_relations_without_caching(schema_relation) %}\n {{ exceptions.raise_not_implemented(\n 'list_function_relations_without_caching macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3497722, "supported_languages": null}, "macro.dbt.get_catalog_for_single_relation": {"name": "get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_catalog_for_single_relation", "macro_sql": "{% macro get_catalog_for_single_relation(relation) %}\n {{ return(adapter.dispatch('get_catalog_for_single_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_catalog_for_single_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3501594, "supported_languages": null}, "macro.dbt.default__get_catalog_for_single_relation": {"name": "default__get_catalog_for_single_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_catalog_for_single_relation", "macro_sql": "{% macro default__get_catalog_for_single_relation(relation) %}\n {{ exceptions.raise_not_implemented(\n 'get_catalog_for_single_relation macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3504796, "supported_languages": null}, "macro.dbt.get_relations": {"name": "get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relations", "macro_sql": "{% macro get_relations() %}\n {{ return(adapter.dispatch('get_relations', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3508031, "supported_languages": null}, "macro.dbt.default__get_relations": {"name": "default__get_relations", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relations", "macro_sql": "{% macro default__get_relations() %}\n {{ exceptions.raise_not_implemented(\n 'get_relations macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3511565, "supported_languages": null}, "macro.dbt.get_relation_last_modified": {"name": "get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.get_relation_last_modified", "macro_sql": "{% macro get_relation_last_modified(information_schema, relations) %}\n {{ return(adapter.dispatch('get_relation_last_modified', 'dbt')(information_schema, relations)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_relation_last_modified"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3515604, "supported_languages": null}, "macro.dbt.default__get_relation_last_modified": {"name": "default__get_relation_last_modified", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/metadata.sql", "original_file_path": "macros/adapters/metadata.sql", "unique_id": "macro.dbt.default__get_relation_last_modified", "macro_sql": "{% macro default__get_relation_last_modified(information_schema, relations) %}\n {{ exceptions.raise_not_implemented(\n 'get_relation_last_modified macro not implemented for adapter ' + adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3519347, "supported_languages": null}, "macro.dbt.make_intermediate_relation": {"name": "make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_intermediate_relation", "macro_sql": "{% macro make_intermediate_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_intermediate_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_intermediate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3532279, "supported_languages": null}, "macro.dbt.default__make_intermediate_relation": {"name": "default__make_intermediate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_intermediate_relation", "macro_sql": "{% macro default__make_intermediate_relation(base_relation, suffix) %}\n {{ return(default__make_temp_relation(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3535628, "supported_languages": null}, "macro.dbt.make_temp_relation": {"name": "make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_temp_relation", "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {#-- This ensures microbatch batches get unique temp relations to avoid clobbering --#}\n {% if suffix == '__dbt_tmp' and model.batch %}\n {% set suffix = suffix ~ '_' ~ model.batch.id %}\n {% endif %}\n\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_temp_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3543546, "supported_languages": null}, "macro.dbt.default__make_temp_relation": {"name": "default__make_temp_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_temp_relation", "macro_sql": "{% macro default__make_temp_relation(base_relation, suffix) %}\n {%- set temp_identifier = base_relation.identifier ~ suffix -%}\n {%- set temp_relation = base_relation.incorporate(\n path={\"identifier\": temp_identifier}) -%}\n\n {{ return(temp_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.354954, "supported_languages": null}, "macro.dbt.make_backup_relation": {"name": "make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.make_backup_relation", "macro_sql": "{% macro make_backup_relation(base_relation, backup_relation_type, suffix='__dbt_backup') %}\n {{ return(adapter.dispatch('make_backup_relation', 'dbt')(base_relation, backup_relation_type, suffix)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__make_backup_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.355424, "supported_languages": null}, "macro.dbt.default__make_backup_relation": {"name": "default__make_backup_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__make_backup_relation", "macro_sql": "{% macro default__make_backup_relation(base_relation, backup_relation_type, suffix) %}\n {%- set backup_identifier = base_relation.identifier ~ suffix -%}\n {%- set backup_relation = base_relation.incorporate(\n path={\"identifier\": backup_identifier},\n type=backup_relation_type\n ) -%}\n {{ return(backup_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3560731, "supported_languages": null}, "macro.dbt.truncate_relation": {"name": "truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.truncate_relation", "macro_sql": "{% macro truncate_relation(relation) -%}\n {{ return(adapter.dispatch('truncate_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__truncate_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.356562, "supported_languages": null}, "macro.dbt.default__truncate_relation": {"name": "default__truncate_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__truncate_relation", "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation.render() }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3569589, "supported_languages": null}, "macro.dbt.get_or_create_relation": {"name": "get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.get_or_create_relation", "macro_sql": "{% macro get_or_create_relation(database, schema, identifier, type) -%}\n {{ return(adapter.dispatch('get_or_create_relation', 'dbt')(database, schema, identifier, type)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_or_create_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.357528, "supported_languages": null}, "macro.dbt.default__get_or_create_relation": {"name": "default__get_or_create_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.default__get_or_create_relation", "macro_sql": "{% macro default__get_or_create_relation(database, schema, identifier, type) %}\n {%- set target_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% if target_relation %}\n {% do return([true, target_relation]) %}\n {% endif %}\n\n {%- set new_relation = api.Relation.create(\n database=database,\n schema=schema,\n identifier=identifier,\n type=type\n ) -%}\n {% do return([false, new_relation]) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.358614, "supported_languages": null}, "macro.dbt.load_cached_relation": {"name": "load_cached_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_cached_relation", "macro_sql": "{% macro load_cached_relation(relation) %}\n {% do return(adapter.get_relation(\n database=relation.database,\n schema=relation.schema,\n identifier=relation.identifier\n )) -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.359077, "supported_languages": null}, "macro.dbt.load_relation": {"name": "load_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/relation.sql", "original_file_path": "macros/adapters/relation.sql", "unique_id": "macro.dbt.load_relation", "macro_sql": "{% macro load_relation(relation) %}\n {{ return(load_cached_relation(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3593621, "supported_languages": null}, "macro.dbt.create_schema": {"name": "create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.create_schema", "macro_sql": "{% macro create_schema(relation) -%}\n {{ adapter.dispatch('create_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3600206, "supported_languages": null}, "macro.dbt.default__create_schema": {"name": "default__create_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__create_schema", "macro_sql": "{% macro default__create_schema(relation) -%}\n {%- call statement('create_schema') -%}\n create schema if not exists {{ relation.without_identifier() }}\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3603876, "supported_languages": null}, "macro.dbt.drop_schema": {"name": "drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.drop_schema", "macro_sql": "{% macro drop_schema(relation) -%}\n {{ adapter.dispatch('drop_schema', 'dbt')(relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_schema"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3607056, "supported_languages": null}, "macro.dbt.default__drop_schema": {"name": "default__drop_schema", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/schema.sql", "original_file_path": "macros/adapters/schema.sql", "unique_id": "macro.dbt.default__drop_schema", "macro_sql": "{% macro default__drop_schema(relation) -%}\n {%- call statement('drop_schema') -%}\n drop schema if exists {{ relation.without_identifier() }} cascade\n {% endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3610911, "supported_languages": null}, "macro.dbt.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness', 'dbt')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3619742, "supported_languages": null}, "macro.dbt.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n select\n max({{ loaded_at_field }}) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endcall %}\n {{ return(load_result('collect_freshness')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3627892, "supported_languages": null}, "macro.dbt.collect_freshness_custom_sql": {"name": "collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.collect_freshness_custom_sql", "macro_sql": "{% macro collect_freshness_custom_sql(source, loaded_at_query) %}\n {{ return(adapter.dispatch('collect_freshness_custom_sql', 'dbt')(source, loaded_at_query))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__collect_freshness_custom_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3632388, "supported_languages": null}, "macro.dbt.default__collect_freshness_custom_sql": {"name": "default__collect_freshness_custom_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/freshness.sql", "original_file_path": "macros/adapters/freshness.sql", "unique_id": "macro.dbt.default__collect_freshness_custom_sql", "macro_sql": "{% macro default__collect_freshness_custom_sql(source, loaded_at_query) %}\n {% call statement('collect_freshness_custom_sql', fetch_result=True, auto_begin=False) -%}\n with source_query as (\n {{ loaded_at_query }}\n )\n select\n (select * from source_query) as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n {% endcall %}\n {{ return(load_result('collect_freshness_custom_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3638825, "supported_languages": null}, "macro.dbt.alter_column_comment": {"name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_column_comment", "macro_sql": "{% macro alter_column_comment(relation, column_dict) -%}\n {{ return(adapter.dispatch('alter_column_comment', 'dbt')(relation, column_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3651052, "supported_languages": null}, "macro.dbt.default__alter_column_comment": {"name": "default__alter_column_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_column_comment", "macro_sql": "{% macro default__alter_column_comment(relation, column_dict) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_column_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3654451, "supported_languages": null}, "macro.dbt.alter_relation_comment": {"name": "alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.alter_relation_comment", "macro_sql": "{% macro alter_relation_comment(relation, relation_comment) -%}\n {{ return(adapter.dispatch('alter_relation_comment', 'dbt')(relation, relation_comment)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__alter_relation_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3658655, "supported_languages": null}, "macro.dbt.default__alter_relation_comment": {"name": "default__alter_relation_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__alter_relation_comment", "macro_sql": "{% macro default__alter_relation_comment(relation, relation_comment) -%}\n {{ exceptions.raise_not_implemented(\n 'alter_relation_comment macro not implemented for adapter '+adapter.type()) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3663192, "supported_languages": null}, "macro.dbt.persist_docs": {"name": "persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.persist_docs", "macro_sql": "{% macro persist_docs(relation, model, for_relation=true, for_columns=true) -%}\n {{ return(adapter.dispatch('persist_docs', 'dbt')(relation, model, for_relation, for_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3668692, "supported_languages": null}, "macro.dbt.validate_doc_columns": {"name": "validate_doc_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.validate_doc_columns", "macro_sql": "{% macro validate_doc_columns(relation, column_dict, existing_column_names) %}\n {% set existing_lower = existing_column_names | map(\"lower\") | list %}\n {% set missing = [] %}\n {% set filtered = {} %}\n {% for col_name in column_dict %}\n {% set is_quoted = column_dict[col_name]['quote'] %}\n {% if is_quoted %}\n {% set present = col_name in existing_column_names %}\n {% else %}\n {% set present = col_name | lower in existing_lower %}\n {% endif %}\n {% if present %}\n {% do filtered.update({col_name: column_dict[col_name]}) %}\n {% else %}\n {% do missing.append(col_name) %}\n {% endif %}\n {% endfor %}\n {% if missing | length > 0 %}\n {{ exceptions.warn(\"In relation \" ~ relation.render() ~ \": The following columns are specified in the schema but are not present in the database: \" ~ missing | join(\", \")) }}\n {% endif %}\n {{ return(filtered) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3689437, "supported_languages": null}, "macro.dbt.default__persist_docs": {"name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/persist_docs.sql", "original_file_path": "macros/adapters/persist_docs.sql", "unique_id": "macro.dbt.default__persist_docs", "macro_sql": "{% macro default__persist_docs(relation, model, for_relation, for_columns) -%}\n {% if for_relation and config.persist_relation_docs() and model.description %}\n {% do run_query(alter_relation_comment(relation, model.description)) %}\n {% endif %}\n\n {% if for_columns and config.persist_column_docs() and model.columns %}\n {% set existing_columns = adapter.get_columns_in_relation(relation) | map(attribute=\"name\") | list %}\n {% set filtered_columns = validate_doc_columns(relation, model.columns, existing_columns) %}\n {% set alter_comment_sql = alter_column_comment(relation, filtered_columns) %}\n {% if alter_comment_sql and alter_comment_sql | trim | length > 0 %}\n {% do run_query(alter_comment_sql) %}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query", "macro.dbt.alter_relation_comment", "macro.dbt.validate_doc_columns", "macro.dbt.alter_column_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.370546, "supported_languages": null}, "macro.dbt.is_core_v2": {"name": "is_core_v2", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/runtime.sql", "original_file_path": "macros/adapters/runtime.sql", "unique_id": "macro.dbt.is_core_v2", "macro_sql": "{% macro is_core_v2() -%}\n {%- set major_version = (dbt_version.split('.') | first) | int -%}\n {{ return(major_version == 2) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3711228, "supported_languages": null}, "macro.dbt.validate_sql": {"name": "validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.validate_sql", "macro_sql": "{% macro validate_sql(sql) -%}\n {{ return(adapter.dispatch('validate_sql', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__validate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3716547, "supported_languages": null}, "macro.dbt.default__validate_sql": {"name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/adapters/validate_sql.sql", "original_file_path": "macros/adapters/validate_sql.sql", "unique_id": "macro.dbt.default__validate_sql", "macro_sql": "{% macro default__validate_sql(sql) -%}\n {% call statement('validate_sql') -%}\n explain {{ sql }}\n {% endcall %}\n {{ return(load_result('validate_sql')) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3721244, "supported_languages": null}, "macro.dbt.convert_datetime": {"name": "convert_datetime", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.convert_datetime", "macro_sql": "{% macro convert_datetime(date_str, date_fmt) %}\n\n {% set error_msg -%}\n The provided partition date '{{ date_str }}' does not match the expected format '{{ date_fmt }}'\n {%- endset %}\n\n {% set res = try_or_compiler_error(error_msg, modules.datetime.datetime.strptime, date_str.strip(), date_fmt) %}\n {{ return(res) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.373517, "supported_languages": null}, "macro.dbt.dates_in_range": {"name": "dates_in_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.dates_in_range", "macro_sql": "{% macro dates_in_range(start_date_str, end_date_str=none, in_fmt=\"%Y%m%d\", out_fmt=\"%Y%m%d\") %}\n {% set end_date_str = start_date_str if end_date_str is none else end_date_str %}\n\n {% set start_date = convert_datetime(start_date_str, in_fmt) %}\n {% set end_date = convert_datetime(end_date_str, in_fmt) %}\n\n {% set day_count = (end_date - start_date).days %}\n {% if day_count < 0 %}\n {% set msg -%}\n Partition start date is after the end date ({{ start_date }}, {{ end_date }})\n {%- endset %}\n\n {{ exceptions.raise_compiler_error(msg, model) }}\n {% endif %}\n\n {% set date_list = [] %}\n {% for i in range(0, day_count + 1) %}\n {% set the_date = (modules.datetime.timedelta(days=i) + start_date) %}\n {% if not out_fmt %}\n {% set _ = date_list.append(the_date) %}\n {% else %}\n {% set _ = date_list.append(the_date.strftime(out_fmt)) %}\n {% endif %}\n {% endfor %}\n\n {{ return(date_list) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.convert_datetime"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3758998, "supported_languages": null}, "macro.dbt.partition_range": {"name": "partition_range", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.partition_range", "macro_sql": "{% macro partition_range(raw_partition_date, date_fmt='%Y%m%d') %}\n {% set partition_range = (raw_partition_date | string).split(\",\") %}\n\n {% if (partition_range | length) == 1 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = none %}\n {% elif (partition_range | length) == 2 %}\n {% set start_date = partition_range[0] %}\n {% set end_date = partition_range[1] %}\n {% else %}\n {{ exceptions.raise_compiler_error(\"Invalid partition time. Expected format: {Start Date}[,{End Date}]. Got: \" ~ raw_partition_date) }}\n {% endif %}\n\n {{ return(dates_in_range(start_date, end_date, in_fmt=date_fmt)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dates_in_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.377477, "supported_languages": null}, "macro.dbt.py_current_timestring": {"name": "py_current_timestring", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/datetime.sql", "original_file_path": "macros/etc/datetime.sql", "unique_id": "macro.dbt.py_current_timestring", "macro_sql": "{% macro py_current_timestring() %}\n {% set dt = modules.datetime.datetime.now() %}\n {% do return(dt.strftime(\"%Y%m%d%H%M%S%f\")) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3779776, "supported_languages": null}, "macro.dbt.statement": {"name": "statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.statement", "macro_sql": "\n{%- macro statement(name=None, fetch_result=False, auto_begin=True, language='sql') -%}\n {%- if execute: -%}\n {%- set compiled_code = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime {} for node \"{}\"'.format(language, model['unique_id'])) }}\n {{ write(compiled_code) }}\n {%- endif -%}\n {%- if language == 'sql'-%}\n {%- set res, table = adapter.execute(compiled_code, auto_begin=auto_begin, fetch=fetch_result) -%}\n {%- elif language == 'python' -%}\n {%- set res = submit_python_job(model, compiled_code) -%}\n {#-- TODO: What should table be for python models? --#}\n {%- set table = None -%}\n {%- else -%}\n {% do exceptions.raise_compiler_error(\"statement macro didn't get supported language\") %}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_result(name, response=res, agate_table=table) }}\n {%- endif -%}\n\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.380491, "supported_languages": null}, "macro.dbt.noop_statement": {"name": "noop_statement", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.noop_statement", "macro_sql": "{% macro noop_statement(name=None, message=None, code=None, rows_affected=None, res=None) -%}\n {%- set sql = caller() -%}\n\n {%- if name == 'main' -%}\n {{ log('Writing runtime SQL for node \"{}\"'.format(model['unique_id'])) }}\n {{ write(sql) }}\n {%- endif -%}\n\n {%- if name is not none -%}\n {{ store_raw_result(name, message=message, code=code, rows_affected=rows_affected, agate_table=res) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3816304, "supported_languages": null}, "macro.dbt.run_query": {"name": "run_query", "resource_type": "macro", "package_name": "dbt", "path": "macros/etc/statement.sql", "original_file_path": "macros/etc/statement.sql", "unique_id": "macro.dbt.run_query", "macro_sql": "{% macro run_query(sql) %}\n {% call statement(\"run_query_statement\", fetch_result=true, auto_begin=false) %}\n {{ sql }}\n {% endcall %}\n\n {% do return(load_result(\"run_query_statement\").table) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3822267, "supported_languages": null}, "macro.dbt.set_sql_header": {"name": "set_sql_header", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.set_sql_header", "macro_sql": "{% macro set_sql_header(config) -%}\n {{ config.set('sql_header', caller()) }}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3828008, "supported_languages": null}, "macro.dbt.should_full_refresh": {"name": "should_full_refresh", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_full_refresh", "macro_sql": "{% macro should_full_refresh() %}\n {% set config_full_refresh = config.get('full_refresh') %}\n {% if config_full_refresh is none %}\n {% set config_full_refresh = flags.FULL_REFRESH %}\n {% endif %}\n {% do return(config_full_refresh) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3834293, "supported_languages": null}, "macro.dbt.should_store_failures": {"name": "should_store_failures", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/configs.sql", "original_file_path": "macros/materializations/configs.sql", "unique_id": "macro.dbt.should_store_failures", "macro_sql": "{% macro should_store_failures() %}\n {% set config_store_failures = config.get('store_failures') %}\n {% if config_store_failures is none %}\n {% set config_store_failures = flags.STORE_FAILURES %}\n {% endif %}\n {% do return(config_store_failures) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3840485, "supported_languages": null}, "macro.dbt.run_hooks": {"name": "run_hooks", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.run_hooks", "macro_sql": "{% macro run_hooks(hooks, inside_transaction=True) %}\n {% for hook in hooks | selectattr('transaction', 'equalto', inside_transaction) %}\n {% if not inside_transaction and loop.first %}\n {% call statement(auto_begin=inside_transaction) %}\n commit;\n {% endcall %}\n {% endif %}\n {% set rendered = render(hook.get('sql')) | trim %}\n {% if (rendered | length) > 0 %}\n {% call statement(auto_begin=inside_transaction) %}\n {{ rendered }}\n {% endcall %}\n {% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3857198, "supported_languages": null}, "macro.dbt.make_hook_config": {"name": "make_hook_config", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.make_hook_config", "macro_sql": "{% macro make_hook_config(sql, inside_transaction) %}\n {{ tojson({\"sql\": sql, \"transaction\": inside_transaction}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3861427, "supported_languages": null}, "macro.dbt.before_begin": {"name": "before_begin", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.before_begin", "macro_sql": "{% macro before_begin(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3864367, "supported_languages": null}, "macro.dbt.in_transaction": {"name": "in_transaction", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.in_transaction", "macro_sql": "{% macro in_transaction(sql) %}\n {{ make_hook_config(sql, inside_transaction=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3867207, "supported_languages": null}, "macro.dbt.after_commit": {"name": "after_commit", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/hooks.sql", "original_file_path": "macros/materializations/hooks.sql", "unique_id": "macro.dbt.after_commit", "macro_sql": "{% macro after_commit(sql) %}\n {{ make_hook_config(sql, inside_transaction=False) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_hook_config"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.387032, "supported_languages": null}, "macro.dbt.materialization_view_default": {"name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/view.sql", "original_file_path": "macros/materializations/models/view.sql", "unique_id": "macro.dbt.materialization_view_default", "macro_sql": "{%- materialization view, default -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='view') -%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n This relation (probably) doesn't exist yet. If it does exist, it's a leftover from\n a previous run, and we're going to try to drop it immediately. At the end of this\n materialization, we're going to rename the \"existing_relation\" to this identifier,\n and then we're going to drop it. In order to make sure we run the correct one of:\n - drop view ...\n - drop table ...\n\n We need to set the type of this relation to be the type of the existing_relation, if it exists,\n or else \"view\" as a sane default if it does not. Note that if the existing_relation does not\n exist, then there is nothing to move out of the way and subsequentally drop. In that case,\n this relation will be effectively unused.\n */\n {%- set backup_relation_type = 'view' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n -- move the existing view out of the way\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.run_hooks", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.391328, "supported_languages": ["sql"]}, "macro.dbt.materialization_materialized_view_default": {"name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialization_materialized_view_default", "macro_sql": "{% materialization materialized_view, default %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.MaterializedView) %}\n {% set intermediate_relation = make_intermediate_relation(target_relation) %}\n {% set backup_relation_type = target_relation.MaterializedView if existing_relation is none else existing_relation.type %}\n {% set backup_relation = make_backup_relation(target_relation, backup_relation_type) %}\n\n {{ materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) }}\n\n {% set build_sql = materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% if build_sql == '' %}\n {{ materialized_view_execute_no_op(target_relation) }}\n {% else %}\n {{ materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) }}\n {% endif %}\n\n {{ materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.materialized_view_setup", "macro.dbt.materialized_view_get_build_sql", "macro.dbt.materialized_view_execute_no_op", "macro.dbt.materialized_view_execute_build_sql", "macro.dbt.materialized_view_teardown"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.394443, "supported_languages": ["sql"]}, "macro.dbt.materialized_view_setup": {"name": "materialized_view_setup", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_setup", "macro_sql": "{% macro materialized_view_setup(backup_relation, intermediate_relation, pre_hooks) %}\n\n -- backup_relation and intermediate_relation should not already exist in the database\n -- it's possible these exist because of a previous run that exited unexpectedly\n {% set preexisting_backup_relation = load_cached_relation(backup_relation) %}\n {% set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3953214, "supported_languages": null}, "macro.dbt.materialized_view_teardown": {"name": "materialized_view_teardown", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_teardown", "macro_sql": "{% macro materialized_view_teardown(backup_relation, intermediate_relation, post_hooks) %}\n\n -- drop the temp relations if they exist to leave the database clean for the next run\n {{ drop_relation_if_exists(backup_relation) }}\n {{ drop_relation_if_exists(intermediate_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.395819, "supported_languages": null}, "macro.dbt.materialized_view_get_build_sql": {"name": "materialized_view_get_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_get_build_sql", "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation.render() ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation.render() ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.get_create_materialized_view_as_sql", "macro.dbt.get_replace_sql", "macro.dbt.get_materialized_view_configuration_changes", "macro.dbt.refresh_materialized_view", "macro.dbt.get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3984277, "supported_languages": null}, "macro.dbt.materialized_view_execute_no_op": {"name": "materialized_view_execute_no_op", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_no_op", "macro_sql": "{% macro materialized_view_execute_no_op(target_relation) %}\n {% do store_raw_result(\n name=\"main\",\n message=\"skip \" ~ target_relation,\n code=\"skip\",\n rows_affected=\"-1\"\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.3989136, "supported_languages": null}, "macro.dbt.materialized_view_execute_build_sql": {"name": "materialized_view_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/materialized_view.sql", "original_file_path": "macros/materializations/models/materialized_view.sql", "unique_id": "macro.dbt.materialized_view_execute_build_sql", "macro_sql": "{% macro materialized_view_execute_build_sql(build_sql, existing_relation, target_relation, post_hooks) %}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4002159, "supported_languages": null}, "macro.dbt.materialization_table_default": {"name": "materialization_table_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/table.sql", "original_file_path": "macros/materializations/models/table.sql", "unique_id": "macro.dbt.materialization_table_default", "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n {% do create_indexes(intermediate_relation) %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.statement", "macro.dbt.get_create_table_as_sql", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4043562, "supported_languages": ["sql"]}, "macro.dbt.incremental_validate_on_schema_change": {"name": "incremental_validate_on_schema_change", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.incremental_validate_on_schema_change", "macro_sql": "{% macro incremental_validate_on_schema_change(on_schema_change, default='ignore') %}\n\n {% if on_schema_change not in ['sync_all_columns', 'append_new_columns', 'fail', 'ignore'] %}\n\n {% set log_message = 'Invalid value for on_schema_change (%s) specified. Setting default value of %s.' % (on_schema_change, default) %}\n {% do log(log_message) %}\n\n {{ return(default) }}\n\n {% else %}\n\n {{ return(on_schema_change) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.406764, "supported_languages": null}, "macro.dbt.check_for_schema_changes": {"name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.check_for_schema_changes", "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n {{ return(adapter.dispatch('check_for_schema_changes', 'dbt')(source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__check_for_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4072247, "supported_languages": null}, "macro.dbt.default__check_for_schema_changes": {"name": "default__check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__check_for_schema_changes", "macro_sql": "{% macro default__check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.diff_columns", "macro.dbt.diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4098692, "supported_languages": null}, "macro.dbt.sync_column_schemas": {"name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.sync_column_schemas", "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n {{ return(adapter.dispatch('sync_column_schemas', 'dbt')(on_schema_change, target_relation, schema_changes_dict)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.410426, "supported_languages": null}, "macro.dbt.default__sync_column_schemas": {"name": "default__sync_column_schemas", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__sync_column_schemas", "macro_sql": "{% macro default__sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.alter_relation_add_remove_columns", "macro.dbt.alter_column_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4128437, "supported_languages": null}, "macro.dbt.process_schema_changes": {"name": "process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.process_schema_changes", "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n {{ return(adapter.dispatch('process_schema_changes', 'dbt')(on_schema_change, source_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__process_schema_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4133244, "supported_languages": null}, "macro.dbt.default__process_schema_changes": {"name": "default__process_schema_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/on_schema_change.sql", "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", "unique_id": "macro.dbt.default__process_schema_changes", "macro_sql": "{% macro default__process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.check_for_schema_changes", "macro.dbt.sync_column_schemas"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4149947, "supported_languages": null}, "macro.dbt.get_merge_sql": {"name": "get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_sql", "macro_sql": "{% macro get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n -- back compat for old kwarg name\n {% set incremental_predicates = kwargs.get('predicates', incremental_predicates) %}\n {{ adapter.dispatch('get_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4171593, "supported_languages": null}, "macro.dbt.get_merge_unique_key_match": {"name": "get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_merge_unique_key_match", "macro_sql": "{% macro get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {{ return(adapter.dispatch('get_merge_unique_key_match', 'dbt')(source_unique_key, target_unique_key)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4175825, "supported_languages": null}, "macro.dbt.default__get_merge_unique_key_match": {"name": "default__get_merge_unique_key_match", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_unique_key_match", "macro_sql": "{% macro default__get_merge_unique_key_match(source_unique_key, target_unique_key) -%}\n {{ return(equals(source_unique_key, target_unique_key) | trim) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4179533, "supported_languages": null}, "macro.dbt.default__get_merge_sql": {"name": "default__get_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_merge_sql", "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set source_unique_key = (\"DBT_INTERNAL_SOURCE.\" ~ unique_key) | trim %}\n {% set target_unique_key = (\"DBT_INTERNAL_DEST.\" ~ unique_key) | trim %}\n {% set unique_key_match = get_merge_unique_key_match(source_unique_key, target_unique_key) %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv", "macro.dbt.get_merge_update_columns", "macro.dbt.get_merge_unique_key_match"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4214416, "supported_languages": null}, "macro.dbt.get_delete_insert_merge_sql": {"name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_delete_insert_merge_sql", "macro_sql": "{% macro get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n {{ adapter.dispatch('get_delete_insert_merge_sql', 'dbt')(target, source, unique_key, dest_columns, incremental_predicates) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4220955, "supported_languages": null}, "macro.dbt.default__get_delete_insert_merge_sql": {"name": "default__get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is string %}\n {% set unique_key = [unique_key] %}\n {% endif %}\n\n {%- set unique_key_str = unique_key|join(', ') -%}\n\n delete from {{ target }} as DBT_INTERNAL_DEST\n where ({{ unique_key_str }}) in (\n select distinct {{ unique_key_str }}\n from {{ source }} as DBT_INTERNAL_SOURCE\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4235566, "supported_languages": null}, "macro.dbt.get_insert_overwrite_merge_sql": {"name": "get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.get_insert_overwrite_merge_sql", "macro_sql": "{% macro get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header=false) -%}\n {{ adapter.dispatch('get_insert_overwrite_merge_sql', 'dbt')(target, source, dest_columns, predicates, include_sql_header) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.424109, "supported_languages": null}, "macro.dbt.default__get_insert_overwrite_merge_sql": {"name": "default__get_insert_overwrite_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/merge.sql", "original_file_path": "macros/materializations/models/incremental/merge.sql", "unique_id": "macro.dbt.default__get_insert_overwrite_merge_sql", "macro_sql": "{% macro default__get_insert_overwrite_merge_sql(target, source, dest_columns, predicates, include_sql_header) -%}\n {#-- The only time include_sql_header is True: --#}\n {#-- BigQuery + insert_overwrite strategy + \"static\" partitions config --#}\n {#-- We should consider including the sql header at the materialization level instead --#}\n\n {%- set predicates = [] if predicates is none else [] + predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none and include_sql_header }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on FALSE\n\n when not matched by source\n {% if predicates %} and {{ predicates | join(' and ') }} {% endif %}\n then delete\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.425399, "supported_languages": null}, "macro.dbt.materialization_incremental_default": {"name": "materialization_incremental_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/incremental.sql", "original_file_path": "macros/materializations/models/incremental/incremental.sql", "unique_id": "macro.dbt.materialization_incremental_default", "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% set relation_for_indexes = target_relation %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set relation_for_indexes = intermediate_relation %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% set relation_for_indexes = temp_relation %}\n {% set contract_config = config.get('contract') %}\n {% if not contract_config or not contract_config.enforced %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {% endif %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(relation_for_indexes) %}\n {% endif %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.make_temp_relation", "macro.dbt.make_intermediate_relation", "macro.dbt.make_backup_relation", "macro.dbt.should_full_refresh", "macro.dbt.incremental_validate_on_schema_change", "macro.dbt.drop_relation_if_exists", "macro.dbt.run_hooks", "macro.dbt.get_create_table_as_sql", "macro.dbt.run_query", "macro.dbt.process_schema_changes", "macro.dbt.statement", "macro.dbt.create_indexes", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4338071, "supported_languages": ["sql"]}, "macro.dbt.get_incremental_append_sql": {"name": "get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_append_sql", "macro_sql": "{% macro get_incremental_append_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_append_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4351218, "supported_languages": null}, "macro.dbt.default__get_incremental_append_sql": {"name": "default__get_incremental_append_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_append_sql", "macro_sql": "{% macro default__get_incremental_append_sql(arg_dict) %}\n\n {% do return(get_insert_into_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_into_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4355927, "supported_languages": null}, "macro.dbt.get_incremental_delete_insert_sql": {"name": "get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_delete_insert_sql", "macro_sql": "{% macro get_incremental_delete_insert_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_delete_insert_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_delete_insert_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4359918, "supported_languages": null}, "macro.dbt.default__get_incremental_delete_insert_sql": {"name": "default__get_incremental_delete_insert_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_delete_insert_sql", "macro_sql": "{% macro default__get_incremental_delete_insert_sql(arg_dict) %}\n\n {% do return(get_delete_insert_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_delete_insert_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4365609, "supported_languages": null}, "macro.dbt.get_incremental_merge_sql": {"name": "get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_merge_sql", "macro_sql": "{% macro get_incremental_merge_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_merge_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4369495, "supported_languages": null}, "macro.dbt.default__get_incremental_merge_sql": {"name": "default__get_incremental_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_merge_sql", "macro_sql": "{% macro default__get_incremental_merge_sql(arg_dict) %}\n\n {% do return(get_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"unique_key\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4375255, "supported_languages": null}, "macro.dbt.get_incremental_insert_overwrite_sql": {"name": "get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_insert_overwrite_sql", "macro_sql": "{% macro get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_insert_overwrite_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_incremental_insert_overwrite_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4379117, "supported_languages": null}, "macro.dbt.default__get_incremental_insert_overwrite_sql": {"name": "default__get_incremental_insert_overwrite_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_insert_overwrite_sql", "macro_sql": "{% macro default__get_incremental_insert_overwrite_sql(arg_dict) %}\n\n {% do return(get_insert_overwrite_merge_sql(arg_dict[\"target_relation\"], arg_dict[\"temp_relation\"], arg_dict[\"dest_columns\"], arg_dict[\"incremental_predicates\"])) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_insert_overwrite_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4384203, "supported_languages": null}, "macro.dbt.get_incremental_default_sql": {"name": "get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_default_sql", "macro_sql": "{% macro get_incremental_default_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_default_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_default_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.438779, "supported_languages": null}, "macro.dbt.default__get_incremental_default_sql": {"name": "default__get_incremental_default_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_default_sql", "macro_sql": "{% macro default__get_incremental_default_sql(arg_dict) %}\n\n {% do return(get_incremental_append_sql(arg_dict)) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_incremental_append_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.439108, "supported_languages": null}, "macro.dbt.get_incremental_microbatch_sql": {"name": "get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_incremental_microbatch_sql", "macro_sql": "{% macro get_incremental_microbatch_sql(arg_dict) %}\n\n {{ return(adapter.dispatch('get_incremental_microbatch_sql', 'dbt')(arg_dict)) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_incremental_microbatch_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4394786, "supported_languages": null}, "macro.dbt.default__get_incremental_microbatch_sql": {"name": "default__get_incremental_microbatch_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.default__get_incremental_microbatch_sql", "macro_sql": "{% macro default__get_incremental_microbatch_sql(arg_dict) %}\n\n {{ exceptions.raise_not_implemented('microbatch materialization strategy not implemented for adapter ' + adapter.type()) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.439798, "supported_languages": null}, "macro.dbt.get_insert_into_sql": {"name": "get_insert_into_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/strategies.sql", "original_file_path": "macros/materializations/models/incremental/strategies.sql", "unique_id": "macro.dbt.get_insert_into_sql", "macro_sql": "{% macro get_insert_into_sql(target_relation, temp_relation, dest_columns) %}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n insert into {{ target_relation }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ temp_relation }}\n )\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_quoted_csv"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.44037, "supported_languages": null}, "macro.dbt.get_quoted_csv": {"name": "get_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_quoted_csv", "macro_sql": "{% macro get_quoted_csv(column_names) %}\n\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote(col)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.442031, "supported_languages": null}, "macro.dbt.diff_columns": {"name": "diff_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_columns", "macro_sql": "{% macro diff_columns(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% set source_names = source_columns | map(attribute = 'column') | list %}\n {% set target_names = target_columns | map(attribute = 'column') | list %}\n\n {# --check whether the name attribute exists in the target - this does not perform a data type check #}\n {% for sc in source_columns %}\n {% if sc.name not in target_names %}\n {{ result.append(sc) }}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4432478, "supported_languages": null}, "macro.dbt.diff_column_data_types": {"name": "diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.diff_column_data_types", "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n {{ return(adapter.dispatch('diff_column_data_types', 'dbt')(source_columns, target_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__diff_column_data_types"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4436815, "supported_languages": null}, "macro.dbt.default__diff_column_data_types": {"name": "default__diff_column_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__diff_column_data_types", "macro_sql": "{% macro default__diff_column_data_types(source_columns, target_columns) %}\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.expanded_data_type != tc.expanded_data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.expanded_data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4449952, "supported_languages": null}, "macro.dbt.get_merge_update_columns": {"name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.get_merge_update_columns", "macro_sql": "{% macro get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {{ return(adapter.dispatch('get_merge_update_columns', 'dbt')(merge_update_columns, merge_exclude_columns, dest_columns)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_merge_update_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4454572, "supported_languages": null}, "macro.dbt.default__get_merge_update_columns": {"name": "default__get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/column_helpers.sql", "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", "unique_id": "macro.dbt.default__get_merge_update_columns", "macro_sql": "{% macro default__get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) %}\n {%- set default_cols = dest_columns | map(attribute=\"quoted\") | list -%}\n\n {%- if merge_update_columns and merge_exclude_columns -%}\n {{ exceptions.raise_compiler_error(\n 'Model cannot specify merge_update_columns and merge_exclude_columns. Please update model to use only one config'\n )}}\n {%- elif merge_update_columns -%}\n {%- set update_columns = merge_update_columns -%}\n {%- elif merge_exclude_columns -%}\n {%- set update_columns = [] -%}\n {%- for column in dest_columns -%}\n {% if column.column | lower not in merge_exclude_columns | map(\"lower\") | list %}\n {%- do update_columns.append(column.quoted) -%}\n {% endif %}\n {%- endfor -%}\n {%- else -%}\n {%- set update_columns = default_cols -%}\n {%- endif -%}\n\n {{ return(update_columns) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4468954, "supported_languages": null}, "macro.dbt.is_incremental": {"name": "is_incremental", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/incremental/is_incremental.sql", "original_file_path": "macros/materializations/models/incremental/is_incremental.sql", "unique_id": "macro.dbt.is_incremental", "macro_sql": "{% macro is_incremental() %}\n {#-- do not run introspective queries in parsing #}\n {% if not execute %}\n {{ return(False) }}\n {% else %}\n {% set relation = adapter.get_relation(this.database, this.schema, this.table) %}\n {{ return(relation is not none\n and relation.type == 'table'\n and model.config.materialized == 'incremental'\n and not should_full_refresh()) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4480362, "supported_languages": null}, "macro.dbt.can_clone_table": {"name": "can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.can_clone_table", "macro_sql": "{% macro can_clone_table() %}\n {{ return(adapter.dispatch('can_clone_table', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__can_clone_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4485173, "supported_languages": null}, "macro.dbt.default__can_clone_table": {"name": "default__can_clone_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/can_clone_table.sql", "original_file_path": "macros/materializations/models/clone/can_clone_table.sql", "unique_id": "macro.dbt.default__can_clone_table", "macro_sql": "{% macro default__can_clone_table() %}\n {{ return(False) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4487617, "supported_languages": null}, "macro.dbt.create_or_replace_clone": {"name": "create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.create_or_replace_clone", "macro_sql": "{% macro create_or_replace_clone(this_relation, defer_relation) %}\n {{ return(adapter.dispatch('create_or_replace_clone', 'dbt')(this_relation, defer_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_or_replace_clone"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4493353, "supported_languages": null}, "macro.dbt.default__create_or_replace_clone": {"name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/create_or_replace_clone.sql", "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", "unique_id": "macro.dbt.default__create_or_replace_clone", "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation.render() }} clone {{ defer_relation.render() }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4496844, "supported_languages": null}, "macro.dbt.materialization_clone_default": {"name": "materialization_clone_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/models/clone/clone.sql", "original_file_path": "macros/materializations/models/clone/clone.sql", "unique_id": "macro.dbt.materialization_clone_default", "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n {%- set grant_config = config.get('grants') -%}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation.render() ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% if target_relation.database == defer_relation.database and\n target_relation.schema == defer_relation.schema and\n target_relation.identifier == defer_relation.identifier %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {% call statement('main') %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endcall %}\n {% endif %}\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.can_clone_table", "macro.dbt.drop_relation_if_exists", "macro.dbt.statement", "macro.dbt.create_or_replace_clone", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4552546, "supported_languages": ["sql"]}, "macro.dbt.function_execute_build_sql": {"name": "function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.function_execute_build_sql", "macro_sql": "{% macro function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n {{ return(adapter.dispatch('function_execute_build_sql', 'dbt')(build_sql, existing_relation, target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4560513, "supported_languages": null}, "macro.dbt.default__function_execute_build_sql": {"name": "default__function_execute_build_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/helpers.sql", "original_file_path": "macros/materializations/functions/helpers.sql", "unique_id": "macro.dbt.default__function_execute_build_sql", "macro_sql": "{% macro default__function_execute_build_sql(build_sql, existing_relation, target_relation) %}\n\n {% set grant_config = config.get('grants') %}\n\n {% call statement(name=\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {{ adapter.commit() }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4571207, "supported_languages": null}, "macro.dbt.materialization_function_default": {"name": "materialization_function_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/function.sql", "original_file_path": "macros/materializations/functions/function.sql", "unique_id": "macro.dbt.materialization_function_default", "macro_sql": "{% materialization function, default, supported_languages=['sql', 'python', 'javascript'] %}\n {% set existing_relation = load_cached_relation(this) %}\n {% set target_relation = this.incorporate(type=this.Function) %}\n\n {{ run_hooks(pre_hooks) }}\n\n {% set function_config = this.get_function_config(model) %}\n {% set macro_name = this.get_function_macro_name(function_config) %}\n\n {# Doing this aliasing of adapter.dispatch is a hacky way to disable the static analysis of actually calling adapter.dispatch #}\n {# This is necessary because the static analysis breaks being able to dynamically pass a macro_name #}\n {% set _dispatch = adapter.dispatch %}\n\n {% set build_sql = _dispatch(macro_name, 'dbt')(target_relation) %}\n {{ function_execute_build_sql(build_sql, existing_relation, target_relation) }}\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.load_cached_relation", "macro.dbt.run_hooks", "macro.dbt.function_execute_build_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4589865, "supported_languages": ["sql", "python", "javascript"]}, "macro.dbt.get_aggregate_function_create_replace_signature": {"name": "get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_create_replace_signature", "macro_sql": "{% macro get_aggregate_function_create_replace_signature(target_relation) %}\n {{ return(adapter.dispatch('get_aggregate_function_create_replace_signature', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_create_replace_signature"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4602354, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_create_replace_signature": {"name": "default__get_aggregate_function_create_replace_signature", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_create_replace_signature", "macro_sql": "{% macro default__get_aggregate_function_create_replace_signature(target_relation) %}\n CREATE OR REPLACE AGGREGATE FUNCTION {{ target_relation.render() }} ({{ get_formatted_aggregate_function_args()}})\n RETURNS {{ model.returns.data_type }}\n {{ get_function_language_specifier() }}\n {{ get_aggregate_function_volatility_specifier() }}\n {% if model.get('language') == 'python' %}\n {{ get_function_python_options() }}\n {% endif %}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_formatted_aggregate_function_args", "macro.dbt.get_function_language_specifier", "macro.dbt.get_aggregate_function_volatility_specifier", "macro.dbt.get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4609816, "supported_languages": null}, "macro.dbt.get_formatted_aggregate_function_args": {"name": "get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_formatted_aggregate_function_args", "macro_sql": "{% macro get_formatted_aggregate_function_args() %}\n {{ return(adapter.dispatch('get_formatted_aggregate_function_args', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_formatted_aggregate_function_args"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4613214, "supported_languages": null}, "macro.dbt.default__get_formatted_aggregate_function_args": {"name": "default__get_formatted_aggregate_function_args", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_formatted_aggregate_function_args", "macro_sql": "{% macro default__get_formatted_aggregate_function_args() %}\n {# conveniently we can reuse the sql scalar function args #}\n {{ formatted_scalar_function_args_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4615567, "supported_languages": null}, "macro.dbt.get_function_language_specifier": {"name": "get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_language_specifier", "macro_sql": "{% macro get_function_language_specifier() %}\n {{ return(adapter.dispatch('get_function_language_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_language_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.461906, "supported_languages": null}, "macro.dbt.default__get_function_language_specifier": {"name": "default__get_function_language_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_language_specifier", "macro_sql": "{% macro default__get_function_language_specifier() %}\n {% set language = model.get('language') %}\n {% if language == 'sql' %}\n {# generally you dont need to specify the language for sql functions #}\n {% elif language == 'python' %}\n LANGUAGE PYTHON\n {% elif language == 'javascript' %}\n LANGUAGE js\n {% else %}\n {{ 'LANGUAGE ' ~ language.upper() }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4626417, "supported_languages": null}, "macro.dbt.get_aggregate_function_volatility_specifier": {"name": "get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_aggregate_function_volatility_specifier", "macro_sql": "{% macro get_aggregate_function_volatility_specifier() %}\n {{ return(adapter.dispatch('get_aggregate_function_volatility_specifier', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_aggregate_function_volatility_specifier"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4630015, "supported_languages": null}, "macro.dbt.default__get_aggregate_function_volatility_specifier": {"name": "default__get_aggregate_function_volatility_specifier", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_aggregate_function_volatility_specifier", "macro_sql": "{% macro default__get_aggregate_function_volatility_specifier() %}\n {{ scalar_function_volatility_sql() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4632213, "supported_languages": null}, "macro.dbt.get_function_python_options": {"name": "get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.get_function_python_options", "macro_sql": "{% macro get_function_python_options() %}\n {{ return(adapter.dispatch('get_function_python_options', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_function_python_options"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4635603, "supported_languages": null}, "macro.dbt.default__get_function_python_options": {"name": "default__get_function_python_options", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/aggregate.sql", "original_file_path": "macros/materializations/functions/aggregate.sql", "unique_id": "macro.dbt.default__get_function_python_options", "macro_sql": "{% macro default__get_function_python_options() %}\n RUNTIME_VERSION = '{{ model.config.get('runtime_version') }}'\n HANDLER = '{{ model.config.get('entry_point') }}'\n {% set packages = model.config.get('packages', []) %}\n {% if packages %}\n PACKAGES = ('{{ packages | join(\"','\") }}')\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4643178, "supported_languages": null}, "macro.dbt.scalar_function_sql": {"name": "scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_sql", "macro_sql": "{% macro scalar_function_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4658954, "supported_languages": null}, "macro.dbt.default__scalar_function_sql": {"name": "default__scalar_function_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_sql", "macro_sql": "{% macro default__scalar_function_sql(target_relation) %}\n {{ scalar_function_create_replace_signature_sql(target_relation) }}\n {{ scalar_function_body_sql() }};\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.scalar_function_create_replace_signature_sql", "macro.dbt.scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4662166, "supported_languages": null}, "macro.dbt.scalar_function_create_replace_signature_sql": {"name": "scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_create_replace_signature_sql", "macro_sql": "{% macro scalar_function_create_replace_signature_sql(target_relation) %}\n {{ return(adapter.dispatch('scalar_function_create_replace_signature_sql', 'dbt')(target_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_create_replace_signature_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4666924, "supported_languages": null}, "macro.dbt.default__scalar_function_create_replace_signature_sql": {"name": "default__scalar_function_create_replace_signature_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_create_replace_signature_sql", "macro_sql": "{% macro default__scalar_function_create_replace_signature_sql(target_relation) %}\n CREATE OR REPLACE FUNCTION {{ target_relation.render() }} ({{ formatted_scalar_function_args_sql()}})\n RETURNS {{ model.returns.data_type }}\n {{ scalar_function_volatility_sql() }}\n AS\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.formatted_scalar_function_args_sql", "macro.dbt.scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.467143, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_sql": {"name": "formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_sql", "macro_sql": "{% macro formatted_scalar_function_args_sql() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__formatted_scalar_function_args_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4674761, "supported_languages": null}, "macro.dbt.formatted_scalar_function_args_javascript": {"name": "formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.formatted_scalar_function_args_javascript", "macro_sql": "{% macro formatted_scalar_function_args_javascript() %}\n {{ return(adapter.dispatch('formatted_scalar_function_args_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__formatted_scalar_function_args_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4678018, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_sql": {"name": "default__formatted_scalar_function_args_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_sql", "macro_sql": "{% macro default__formatted_scalar_function_args_sql() %}\n {% set args = [] %}\n {% for arg in model.arguments -%}\n {%- do args.append(arg.name ~ ' ' ~ arg.data_type) -%}\n {%- endfor %}\n {{ args | join(', ') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.468469, "supported_languages": null}, "macro.dbt.default__formatted_scalar_function_args_javascript": {"name": "default__formatted_scalar_function_args_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__formatted_scalar_function_args_javascript", "macro_sql": "{% macro default__formatted_scalar_function_args_javascript() %}\n {% set msg = \"formatted_scalar_function_args_javascript not implemented for adapter \" ~ adapter.type() %}\n {% do exceptions.raise_compiler_error(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4689002, "supported_languages": null}, "macro.dbt.scalar_function_body_sql": {"name": "scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_body_sql", "macro_sql": "{% macro scalar_function_body_sql() %}\n {{ return(adapter.dispatch('scalar_function_body_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_body_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4692328, "supported_languages": null}, "macro.dbt.default__scalar_function_body_sql": {"name": "default__scalar_function_body_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_body_sql", "macro_sql": "{% macro default__scalar_function_body_sql() %}\n $$\n {{ model.compiled_code }}\n $$ LANGUAGE SQL\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4694614, "supported_languages": null}, "macro.dbt.scalar_function_volatility_sql": {"name": "scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_sql", "macro_sql": "{% macro scalar_function_volatility_sql() %}\n {{ return(adapter.dispatch('scalar_function_volatility_sql', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4697847, "supported_languages": null}, "macro.dbt.scalar_function_volatility_javascript": {"name": "scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.scalar_function_volatility_javascript", "macro_sql": "{% macro scalar_function_volatility_javascript() %}\n {{ return(adapter.dispatch('scalar_function_volatility_javascript', 'dbt')()) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__scalar_function_volatility_javascript"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4701388, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_javascript": {"name": "default__scalar_function_volatility_javascript", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_javascript", "macro_sql": "{% macro default__scalar_function_volatility_javascript() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility != none %}\n {% set msg = \"Volatility is not supported by \" ~ adapter.type() ~ \" in javascript UDF and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4708436, "supported_languages": null}, "macro.dbt.default__scalar_function_volatility_sql": {"name": "default__scalar_function_volatility_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__scalar_function_volatility_sql", "macro_sql": "{% macro default__scalar_function_volatility_sql() %}\n {% set volatility = model.config.get('volatility') %}\n {% if volatility == 'deterministic' %}\n IMMUTABLE\n {% elif volatility == 'stable' %}\n STABLE\n {% elif volatility == 'non-deterministic' %}\n VOLATILE\n {% elif volatility != none %}\n {# This shouldn't happen unless a new volatility is invented #}\n {% do unsupported_volatility_warning(volatility) %}\n {% endif %}\n {# If no volatility is set, don't add anything and let the data warehouse default it #}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4716597, "supported_languages": null}, "macro.dbt.unsupported_volatility_warning": {"name": "unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.unsupported_volatility_warning", "macro_sql": "{% macro unsupported_volatility_warning(volatility) %}\n {{ return(adapter.dispatch('unsupported_volatility_warning', 'dbt')(volatility)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__unsupported_volatility_warning"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4720554, "supported_languages": null}, "macro.dbt.default__unsupported_volatility_warning": {"name": "default__unsupported_volatility_warning", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/functions/scalar.sql", "original_file_path": "macros/materializations/functions/scalar.sql", "unique_id": "macro.dbt.default__unsupported_volatility_warning", "macro_sql": "{% macro default__unsupported_volatility_warning(volatility) %}\n {% set msg = \"Found `\" ~ volatility ~ \"` volatility specified on function `\" ~ model.name ~ \"`. This volatility is not supported by \" ~ adapter.type() ~ \", and will be ignored\" %}\n {% do exceptions.warn(msg) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4725726, "supported_languages": null}, "macro.dbt.create_columns": {"name": "create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.create_columns", "macro_sql": "{% macro create_columns(relation, columns) %}\n {{ adapter.dispatch('create_columns', 'dbt')(relation, columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.47651, "supported_languages": null}, "macro.dbt.default__create_columns": {"name": "default__create_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__create_columns", "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation.render() }} add column {{ adapter.quote(column.name) }} {{ column.expanded_data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4773166, "supported_languages": null}, "macro.dbt.post_snapshot": {"name": "post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.post_snapshot", "macro_sql": "{% macro post_snapshot(staging_relation) %}\n {{ adapter.dispatch('post_snapshot', 'dbt')(staging_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.477793, "supported_languages": null}, "macro.dbt.default__post_snapshot": {"name": "default__post_snapshot", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__post_snapshot", "macro_sql": "{% macro default__post_snapshot(staging_relation) %}\n {# no-op #}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4780493, "supported_languages": null}, "macro.dbt.get_true_sql": {"name": "get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_true_sql", "macro_sql": "{% macro get_true_sql() %}\n {{ adapter.dispatch('get_true_sql', 'dbt')() }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_true_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4783578, "supported_languages": null}, "macro.dbt.default__get_true_sql": {"name": "default__get_true_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__get_true_sql", "macro_sql": "{% macro default__get_true_sql() %}\n {{ return('TRUE') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4786, "supported_languages": null}, "macro.dbt.snapshot_staging_table": {"name": "snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.snapshot_staging_table", "macro_sql": "{% macro snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {{ adapter.dispatch('snapshot_staging_table', 'dbt')(strategy, source_sql, target_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_staging_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4790318, "supported_languages": null}, "macro.dbt.get_snapshot_table_column_names": {"name": "get_snapshot_table_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_snapshot_table_column_names", "macro_sql": "{% macro get_snapshot_table_column_names() %}\n {{ return({'dbt_valid_to': 'dbt_valid_to', 'dbt_valid_from': 'dbt_valid_from', 'dbt_scd_id': 'dbt_scd_id', 'dbt_updated_at': 'dbt_updated_at', 'dbt_is_deleted': 'dbt_is_deleted'}) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4795449, "supported_languages": null}, "macro.dbt.default__snapshot_staging_table": {"name": "default__snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__snapshot_staging_table", "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n {% if strategy.hard_deletes == 'new_record' %}\n {% set new_scd_id = snapshot_hash_arguments([columns.dbt_scd_id, snapshot_get_time()]) %}\n {% endif %}\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from {{ target_relation }}\n where\n {% if config.get('dbt_valid_to_current') %}\n\t\t{% set source_unique_key = columns.dbt_valid_to | trim %}\n\t\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\n\t\t{# The exact equals semantics between NULL values depends on the current behavior flag set. Also, update records if the source field is null #}\n ( {{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null )\n {% else %}\n {{ columns.dbt_valid_to }} is null\n {% endif %}\n\n ),\n\n insertions_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }},\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }}\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_to }}\n\n from snapshot_query\n ),\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n\n deletes_source_data as (\n\n select *, {{ unique_key_fields(strategy.unique_key) }}\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n {%- if strategy.hard_deletes == 'new_record' -%}\n ,'False' as {{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from insertions_source_data as source_data\n left outer join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"snapshotted_data\") }}\n or ({{ unique_key_is_not_null(strategy.unique_key, \"snapshotted_data\") }} and (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n\n from updates_source_data as source_data\n join snapshotted_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where (\n {{ strategy.row_changed }} {%- if strategy.hard_deletes == 'new_record' -%} or snapshotted_data.{{ columns.dbt_is_deleted }} = 'True' {% endif %}\n )\n )\n\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n ,\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_to }},\n snapshotted_data.{{ columns.dbt_scd_id }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , snapshotted_data.{{ columns.dbt_is_deleted }}\n {%- endif %}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n and not (\n --avoid updating the record's valid_to if the latest entry is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n {%- endif %}\n )\n {%- endif %}\n\n {%- if strategy.hard_deletes == 'new_record' %}\n {% set snapshotted_cols = get_list_of_column_names(get_columns_in_relation(target_relation)) %}\n {% set source_col_names = get_columns_in_query(source_sql) %}\n ,\n deletion_records as (\n\n select\n 'insert' as dbt_change_type,\n {%- for col_name in source_col_names -%}\n {%- if col_name in snapshotted_cols -%}\n snapshotted_data.{{ adapter.quote(col_name) }},\n {%- else -%}\n source_data.{{ adapter.quote(col_name) }},\n {%- endif -%}\n {% endfor -%}\n {%- if strategy.unique_key | is_list -%}\n {%- for key in strategy.unique_key -%}\n snapshotted_data.{{ key }} as dbt_unique_key_{{ loop.index }},\n {% endfor -%}\n {%- else -%}\n snapshotted_data.dbt_unique_key as dbt_unique_key,\n {% endif -%}\n {{ snapshot_get_time() }} as {{ columns.dbt_valid_from }},\n {{ snapshot_get_time() }} as {{ columns.dbt_updated_at }},\n snapshotted_data.{{ columns.dbt_valid_to }} as {{ columns.dbt_valid_to }},\n {{ new_scd_id }} as {{ columns.dbt_scd_id }},\n 'True' as {{ columns.dbt_is_deleted }}\n from snapshotted_data\n left join deletes_source_data as source_data\n on {{ unique_key_join_on(strategy.unique_key, \"snapshotted_data\", \"source_data\") }}\n where {{ unique_key_is_null(strategy.unique_key, \"source_data\") }}\n and not (\n --avoid inserting a new record if the latest one is marked as deleted\n snapshotted_data.{{ columns.dbt_is_deleted }} = 'True'\n and\n {% if config.get('dbt_valid_to_current') -%}\n snapshotted_data.{{ columns.dbt_valid_to }} = {{ config.get('dbt_valid_to_current') }}\n {%- else -%}\n snapshotted_data.{{ columns.dbt_valid_to }} is null\n {%- endif %}\n )\n\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.hard_deletes == 'invalidate' or strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletes\n {%- endif %}\n {%- if strategy.hard_deletes == 'new_record' %}\n union all\n select * from deletion_records\n {%- endif %}\n\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments", "macro.dbt.snapshot_get_time", "macro.dbt.unique_key_fields", "macro.dbt.equals", "macro.dbt.get_dbt_valid_to_current", "macro.dbt.unique_key_join_on", "macro.dbt.unique_key_is_null", "macro.dbt.unique_key_is_not_null", "macro.dbt.get_list_of_column_names", "macro.dbt.get_columns_in_relation", "macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.488368, "supported_languages": null}, "macro.dbt.build_snapshot_table": {"name": "build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_table", "macro_sql": "{% macro build_snapshot_table(strategy, sql) -%}\n {{ adapter.dispatch('build_snapshot_table', 'dbt')(strategy, sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__build_snapshot_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4888158, "supported_languages": null}, "macro.dbt.default__build_snapshot_table": {"name": "default__build_snapshot_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.default__build_snapshot_table", "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n {% set columns = config.get('snapshot_table_column_names') or get_snapshot_table_column_names() %}\n\n select *,\n {{ strategy.scd_id }} as {{ columns.dbt_scd_id }},\n {{ strategy.updated_at }} as {{ columns.dbt_updated_at }},\n {{ strategy.updated_at }} as {{ columns.dbt_valid_from }},\n {{ get_dbt_valid_to_current(strategy, columns) }}\n {%- if strategy.hard_deletes == 'new_record' -%}\n , 'False' as {{ columns.dbt_is_deleted }}\n {% endif -%}\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.get_dbt_valid_to_current"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4898992, "supported_languages": null}, "macro.dbt.build_snapshot_staging_table": {"name": "build_snapshot_staging_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.build_snapshot_staging_table", "macro_sql": "{% macro build_snapshot_staging_table(strategy, sql, target_relation) %}\n {% set temp_relation = make_temp_relation(target_relation) %}\n\n {% set select = snapshot_staging_table(strategy, sql, target_relation) %}\n\n {% call statement('build_snapshot_staging_relation') %}\n {{ create_table_as(True, temp_relation, select) }}\n {% endcall %}\n\n {% do return(temp_relation) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.make_temp_relation", "macro.dbt.snapshot_staging_table", "macro.dbt.statement", "macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4907444, "supported_languages": null}, "macro.dbt.get_updated_at_column_data_type": {"name": "get_updated_at_column_data_type", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_updated_at_column_data_type", "macro_sql": "{% macro get_updated_at_column_data_type(snapshot_sql) %}\n {% set snapshot_sql_column_schema = get_column_schema_from_query(snapshot_sql) %}\n {% set dbt_updated_at_data_type = null %}\n {% set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {% set ns.dbt_updated_at_data_type = null -%}\n {% for column in snapshot_sql_column_schema %}\n {% if ((column.column == 'dbt_updated_at') or (column.column == 'DBT_UPDATED_AT')) %}\n {% set ns.dbt_updated_at_data_type = column.dtype %}\n {% endif %}\n {% endfor %}\n {{ return(ns.dbt_updated_at_data_type or none) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4919415, "supported_languages": null}, "macro.dbt.check_time_data_types": {"name": "check_time_data_types", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.check_time_data_types", "macro_sql": "{% macro check_time_data_types(sql) %}\n {% set dbt_updated_at_data_type = get_updated_at_column_data_type(sql) %}\n {% set snapshot_get_time_data_type = get_snapshot_get_time_data_type() %}\n {% if snapshot_get_time_data_type is not none and dbt_updated_at_data_type is not none and snapshot_get_time_data_type != dbt_updated_at_data_type %}\n {% if exceptions.warn_snapshot_timestamp_data_types %}\n {{ exceptions.warn_snapshot_timestamp_data_types(snapshot_get_time_data_type, dbt_updated_at_data_type) }}\n {% endif %}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_updated_at_column_data_type", "macro.dbt.get_snapshot_get_time_data_type"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4927852, "supported_languages": null}, "macro.dbt.get_dbt_valid_to_current": {"name": "get_dbt_valid_to_current", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.get_dbt_valid_to_current", "macro_sql": "{% macro get_dbt_valid_to_current(strategy, columns) %}\n {% set dbt_valid_to_current = config.get('dbt_valid_to_current') or \"null\" %}\n coalesce(nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}), {{dbt_valid_to_current}})\n as {{ columns.dbt_valid_to }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.493379, "supported_languages": null}, "macro.dbt.unique_key_fields": {"name": "unique_key_fields", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_fields", "macro_sql": "{% macro unique_key_fields(unique_key) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n {{ key }} as dbt_unique_key_{{ loop.index }}\n {%- if not loop.last %} , {%- endif %}\n {% endfor %}\n {% else %}\n {{ unique_key }} as dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4940832, "supported_languages": null}, "macro.dbt.unique_key_join_on": {"name": "unique_key_join_on", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_join_on", "macro_sql": "{% macro unique_key_join_on(unique_key, identifier, from_identifier) %}\n {% if unique_key | is_list %}\n {% for key in unique_key %}\n\t {% set source_unique_key = (identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {% set target_unique_key = (from_identifier ~ \".dbt_unique_key_\" ~ loop.index) | trim %}\n\t {{ equals(source_unique_key, target_unique_key) }}\n {%- if not loop.last %} and {%- endif %}\n {% endfor %}\n {% else %}\n {{ identifier }}.dbt_unique_key = {{ from_identifier }}.dbt_unique_key\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4952497, "supported_languages": null}, "macro.dbt.unique_key_is_null": {"name": "unique_key_is_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_null", "macro_sql": "{% macro unique_key_is_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is null\n {% else %}\n {{ identifier }}.dbt_unique_key is null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.495673, "supported_languages": null}, "macro.dbt.unique_key_is_not_null": {"name": "unique_key_is_not_null", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/helpers.sql", "original_file_path": "macros/materializations/snapshots/helpers.sql", "unique_id": "macro.dbt.unique_key_is_not_null", "macro_sql": "{% macro unique_key_is_not_null(unique_key, identifier) %}\n {% if unique_key | is_list %}\n {{ identifier }}.dbt_unique_key_1 is not null\n {% else %}\n {{ identifier }}.dbt_unique_key is not null\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.4961157, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5001378, "supported_languages": null}, "macro.dbt.snapshot_hash_arguments": {"name": "snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_hash_arguments", "macro_sql": "{% macro snapshot_hash_arguments(args) -%}\n {{ adapter.dispatch('snapshot_hash_arguments', 'dbt')(args) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5004861, "supported_languages": null}, "macro.dbt.default__snapshot_hash_arguments": {"name": "default__snapshot_hash_arguments", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_hash_arguments", "macro_sql": "{% macro default__snapshot_hash_arguments(args) -%}\n md5({%- for arg in args -%}\n coalesce(cast({{ arg }} as varchar ), '')\n {% if not loop.last %} || '|' || {% endif %}\n {%- endfor -%})\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.500967, "supported_languages": null}, "macro.dbt.snapshot_timestamp_strategy": {"name": "snapshot_timestamp_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_timestamp_strategy", "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set primary_key = config.get('unique_key') %}\n {% set updated_at = config.get('updated_at') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.{{ columns.dbt_valid_from }} < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5030558, "supported_languages": null}, "macro.dbt.snapshot_string_as_time": {"name": "snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_string_as_time", "macro_sql": "{% macro snapshot_string_as_time(timestamp) -%}\n {{ adapter.dispatch('snapshot_string_as_time', 'dbt')(timestamp) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_string_as_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5034, "supported_languages": null}, "macro.dbt.default__snapshot_string_as_time": {"name": "default__snapshot_string_as_time", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.default__snapshot_string_as_time", "macro_sql": "{% macro default__snapshot_string_as_time(timestamp) %}\n {% do exceptions.raise_not_implemented(\n 'snapshot_string_as_time macro not implemented for adapter '+adapter.type()\n ) %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5037565, "supported_languages": null}, "macro.dbt.snapshot_check_all_get_existing_columns": {"name": "snapshot_check_all_get_existing_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_all_get_existing_columns", "macro_sql": "{% macro snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) -%}\n {%- if not target_exists -%}\n {#-- no table yet -> return whatever the query does --#}\n {{ return((false, query_columns)) }}\n {%- endif -%}\n\n {#-- handle any schema changes --#}\n {%- set target_relation = adapter.get_relation(database=node.database, schema=node.schema, identifier=node.alias) -%}\n\n {% if check_cols_config == 'all' %}\n {%- set query_columns = get_columns_in_query(node['compiled_code']) -%}\n\n {% elif check_cols_config is iterable and (check_cols_config | length) > 0 %}\n {#-- query for proper casing/quoting, to support comparison below --#}\n {%- set select_check_cols_from_target -%}\n {#-- N.B. The whitespace below is necessary to avoid edge case issue with comments --#}\n {#-- See: https://github.com/dbt-labs/dbt-core/issues/6781 --#}\n select {{ check_cols_config | join(', ') }} from (\n {{ node['compiled_code'] }}\n ) subq\n {%- endset -%}\n {% set query_columns = get_columns_in_query(select_check_cols_from_target) %}\n\n {% else %}\n {% do exceptions.raise_compiler_error(\"Invalid value for 'check_cols': \" ~ check_cols_config) %}\n {% endif %}\n\n {%- set existing_cols = adapter.get_columns_in_relation(target_relation) | map(attribute = 'name') | list -%}\n {%- set ns = namespace() -%} {#-- handle for-loop scoping with a namespace --#}\n {%- set ns.column_added = false -%}\n\n {%- set intersection = [] -%}\n {%- for col in query_columns -%}\n {%- if col in existing_cols -%}\n {%- do intersection.append(adapter.quote(col)) -%}\n {%- else -%}\n {% set ns.column_added = true %}\n {%- endif -%}\n {%- endfor -%}\n {{ return((ns.column_added, intersection)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5065746, "supported_languages": null}, "macro.dbt.snapshot_check_strategy": {"name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/strategies.sql", "original_file_path": "macros/materializations/snapshots/strategies.sql", "unique_id": "macro.dbt.snapshot_check_strategy", "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, model_config, target_exists) %}\n {# The model_config parameter is no longer used, but is passed in anyway for compatibility. #}\n {% set check_cols_config = config.get('check_cols') %}\n {% set primary_key = config.get('unique_key') %}\n {% set hard_deletes = adapter.get_hard_deletes_behavior(config) %}\n {% set invalidate_hard_deletes = hard_deletes == 'invalidate' %}\n {% set updated_at = config.get('updated_at') or snapshot_get_time() %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_args = api.Relation.scd_args(primary_key, updated_at) %}\n {% set scd_id_expr = snapshot_hash_arguments(scd_args) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes,\n \"hard_deletes\": hard_deletes\n }) %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.snapshot_get_time", "macro.dbt.snapshot_check_all_get_existing_columns", "macro.dbt.get_true_sql", "macro.dbt.snapshot_hash_arguments"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5095036, "supported_languages": null}, "macro.dbt.materialization_snapshot_default": {"name": "materialization_snapshot_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot.sql", "original_file_path": "macros/materializations/snapshots/snapshot.sql", "unique_id": "macro.dbt.materialization_snapshot_default", "macro_sql": "{% materialization snapshot, default %}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {# The model['config'] parameter below is no longer used, but passing anyway for compatibility #}\n {# It was a dictionary of config, instead of the config object from the context #}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", model['config'], target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set build_or_select_sql = build_sql %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {% set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() %}\n\n {{ adapter.assert_valid_snapshot_target_given_strategy(target_relation, columns, strategy) }}\n\n {% set build_or_select_sql = snapshot_staging_table(strategy, sql, target_relation) %}\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set remove_columns = ['dbt_change_type', 'DBT_CHANGE_TYPE', 'dbt_unique_key', 'DBT_UNIQUE_KEY'] %}\n {% if unique_key | is_list %}\n {% for key in strategy.unique_key %}\n {{ remove_columns.append('dbt_unique_key_' + loop.index|string) }}\n {{ remove_columns.append('DBT_UNIQUE_KEY_' + loop.index|string) }}\n {% endfor %}\n {% endif %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'in', remove_columns)\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n\n {{ check_time_data_types(build_or_select_sql) }}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.get_or_create_relation", "macro.dbt.run_hooks", "macro.dbt.strategy_dispatch", "macro.dbt.build_snapshot_table", "macro.dbt.create_table_as", "macro.dbt.get_snapshot_table_column_names", "macro.dbt.snapshot_staging_table", "macro.dbt.build_snapshot_staging_table", "macro.dbt.create_columns", "macro.dbt.snapshot_merge_sql", "macro.dbt.check_time_data_types", "macro.dbt.statement", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes", "macro.dbt.post_snapshot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5175724, "supported_languages": ["sql"]}, "macro.dbt.snapshot_merge_sql": {"name": "snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.snapshot_merge_sql", "macro_sql": "{% macro snapshot_merge_sql(target, source, insert_cols) -%}\n {{ adapter.dispatch('snapshot_merge_sql', 'dbt')(target, source, insert_cols) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__snapshot_merge_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5184875, "supported_languages": null}, "macro.dbt.default__snapshot_merge_sql": {"name": "default__snapshot_merge_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/snapshots/snapshot_merge.sql", "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", "unique_id": "macro.dbt.default__snapshot_merge_sql", "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n {%- set columns = config.get(\"snapshot_table_column_names\") or get_snapshot_table_column_names() -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.{{ columns.dbt_scd_id }} = DBT_INTERNAL_DEST.{{ columns.dbt_scd_id }}\n\n when matched\n {% if config.get(\"dbt_valid_to_current\") %}\n\t{% set source_unique_key = (\"DBT_INTERNAL_DEST.\" ~ columns.dbt_valid_to) | trim %}\n\t{% set target_unique_key = config.get('dbt_valid_to_current') | trim %}\n\tand ({{ equals(source_unique_key, target_unique_key) }} or {{ source_unique_key }} is null)\n\n {% else %}\n and DBT_INTERNAL_DEST.{{ columns.dbt_valid_to }} is null\n {% endif %}\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set {{ columns.dbt_valid_to }} = DBT_INTERNAL_SOURCE.{{ columns.dbt_valid_to }}\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_snapshot_table_column_names", "macro.dbt.equals"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5201614, "supported_languages": null}, "macro.dbt.get_test_sql": {"name": "get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_test_sql", "macro_sql": "{% macro get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n {{ adapter.dispatch('get_test_sql', 'dbt')(main_sql, fail_calc, warn_if, error_if, limit) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5212576, "supported_languages": null}, "macro.dbt.default__get_test_sql": {"name": "default__get_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_test_sql", "macro_sql": "{% macro default__get_test_sql(main_sql, fail_calc, warn_if, error_if, limit) -%}\n select\n {{ fail_calc }} as failures,\n {{ fail_calc }} {{ warn_if }} as should_warn,\n {{ fail_calc }} {{ error_if }} as should_error\n from (\n {{ main_sql }}\n {{ \"limit \" ~ limit if limit != none }}\n ) dbt_internal_test\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5218995, "supported_languages": null}, "macro.dbt.get_unit_test_sql": {"name": "get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.get_unit_test_sql", "macro_sql": "{% macro get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n {{ adapter.dispatch('get_unit_test_sql', 'dbt')(main_sql, expected_fixture_sql, expected_column_names) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_unit_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5223217, "supported_languages": null}, "macro.dbt.default__get_unit_test_sql": {"name": "default__get_unit_test_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/helpers.sql", "original_file_path": "macros/materializations/tests/helpers.sql", "unique_id": "macro.dbt.default__get_unit_test_sql", "macro_sql": "{% macro default__get_unit_test_sql(main_sql, expected_fixture_sql, expected_column_names) -%}\n-- Build actual result given inputs\nwith dbt_internal_unit_test_actual as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%},{% endif %}{%- endfor -%}, {{ dbt.string_literal(\"actual\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ main_sql }}\n ) _dbt_internal_unit_test_actual\n),\n-- Build expected result\ndbt_internal_unit_test_expected as (\n select\n {% for expected_column_name in expected_column_names %}{{expected_column_name}}{% if not loop.last -%}, {% endif %}{%- endfor -%}, {{ dbt.string_literal(\"expected\") }} as {{ adapter.quote(\"actual_or_expected\") }}\n from (\n {{ expected_fixture_sql }}\n ) _dbt_internal_unit_test_expected\n)\n-- Union actual and expected results\nselect * from dbt_internal_unit_test_actual\nunion all\nselect * from dbt_internal_unit_test_expected\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.string_literal"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5235388, "supported_languages": null}, "macro.dbt.materialization_unit_default": {"name": "materialization_unit_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/unit.sql", "original_file_path": "macros/materializations/tests/unit.sql", "unique_id": "macro.dbt.materialization_unit_default", "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- set column_name_to_quoted = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n {%- endfor -%}\n\n {%- set expected_column_names_quoted = [] -%}\n {%- for column_name in tested_expected_column_names -%}\n {%- do expected_column_names_quoted.append(column_name_to_quoted[column_name|lower]) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types, column_name_to_quoted) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, expected_column_names_quoted) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_columns_in_query", "macro.dbt.make_temp_relation", "macro.dbt.run_query", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_empty_subquery_sql", "macro.dbt.get_expected_sql", "macro.dbt.get_unit_test_sql", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5276382, "supported_languages": ["sql"]}, "macro.dbt.materialization_test_default": {"name": "materialization_test_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/test.sql", "original_file_path": "macros/materializations/tests/test.sql", "unique_id": "macro.dbt.materialization_test_default", "macro_sql": "{%- materialization test, default -%}\n\n {% set relations = [] %}\n {% set limit = config.get('limit') %}\n {% set sql_header = config.get('sql_header') if flags.REQUIRE_SQL_HEADER_IN_TEST_CONFIGS else none %}\n\n {% set sql_with_limit %}\n {{ get_limit_subquery_sql(sql, limit) }}\n {% endset %}\n\n {% if should_store_failures() %}\n\n {% set identifier = model['alias'] %}\n {% set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) %}\n\n {% set store_failures_as = config.get('store_failures_as') %}\n -- if `--store-failures` is invoked via command line and `store_failures_as` is not set,\n -- config.get('store_failures_as', 'table') returns None, not 'table'\n {% if store_failures_as == none %}{% set store_failures_as = 'table' %}{% endif %}\n {% if store_failures_as not in ['table', 'view'] %}\n {{ exceptions.raise_compiler_error(\n \"'\" ~ store_failures_as ~ \"' is not a valid value for `store_failures_as`. \"\n \"Accepted values are: ['ephemeral', 'table', 'view']\"\n ) }}\n {% endif %}\n\n {% set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database, type=store_failures_as) -%} %}\n\n {% if old_relation %}\n {% do adapter.drop_relation(old_relation) %}\n {% endif %}\n\n {% call statement(auto_begin=True) %}\n {% if sql_header %}{{ sql_header }}{% endif %}\n {{ get_create_sql(target_relation, sql_with_limit) }}\n {% endcall %}\n\n {% do relations.append(target_relation) %}\n\n {# Since the test failures have already been saved to the database, reuse that result rather than querying again #}\n {% set main_sql %}\n select *\n from {{ target_relation }}\n {% endset %}\n\n {{ adapter.commit() }}\n\n {% else %}\n\n {% set main_sql = sql_with_limit %}\n\n {% endif %}\n\n {% set fail_calc = config.get('fail_calc') %}\n {% set warn_if = config.get('warn_if') %}\n {% set error_if = config.get('error_if') %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {% if sql_header %}{{ sql_header }}{% endif %}\n {# The limit has already been included above, and we do not want to duplicate it again. We also want to be safe for macro overrides treating `limit` as a required parameter. #}\n {{ get_test_sql(main_sql, fail_calc, warn_if, error_if, limit=none)}}\n\n {%- endcall %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": {"macros": ["macro.dbt.get_limit_subquery_sql", "macro.dbt.should_store_failures", "macro.dbt.statement", "macro.dbt.get_create_sql", "macro.dbt.get_test_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.532791, "supported_languages": ["sql"]}, "macro.dbt.get_where_subquery": {"name": "get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.get_where_subquery", "macro_sql": "{% macro get_where_subquery(relation) -%}\n {% do return(adapter.dispatch('get_where_subquery', 'dbt')(relation)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_where_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5334928, "supported_languages": null}, "macro.dbt.default__get_where_subquery": {"name": "default__get_where_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/tests/where_subquery.sql", "original_file_path": "macros/materializations/tests/where_subquery.sql", "unique_id": "macro.dbt.default__get_where_subquery", "macro_sql": "{% macro default__get_where_subquery(relation) -%}\n {% set where = config.get('where', '') %}\n {% if where %}\n {%- set filtered -%}\n (select * from {{ relation }} where {{ where }}) dbt_subquery\n {%- endset -%}\n {% do return(filtered) %}\n {%- else -%}\n {% do return(relation) %}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5342808, "supported_languages": null}, "macro.dbt.materialization_seed_default": {"name": "materialization_seed_default", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/seed.sql", "original_file_path": "macros/materializations/seeds/seed.sql", "unique_id": "macro.dbt.materialization_seed_default", "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation.render())) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = \"\" %}\n {% if rows_affected > 0 %}\n {% set sql = load_csv_rows(model, agate_table) %}\n {% endif %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": {"macros": ["macro.dbt.should_full_refresh", "macro.dbt.run_hooks", "macro.dbt.reset_csv_table", "macro.dbt.create_csv_table", "macro.dbt.load_csv_rows", "macro.dbt.noop_statement", "macro.dbt.get_csv_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants", "macro.dbt.persist_docs", "macro.dbt.create_indexes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.539511, "supported_languages": ["sql"]}, "macro.dbt.create_csv_table": {"name": "create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.create_csv_table", "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5413592, "supported_languages": null}, "macro.dbt.default__create_csv_table": {"name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__create_csv_table", "macro_sql": "{% macro default__create_csv_table(model, agate_table) %}\n {%- set column_override = model['config'].get('column_types', {}) -%}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n\n {% set sql %}\n create table {{ this.render() }} (\n {%- for col_name in agate_table.column_names -%}\n {%- set inferred_type = adapter.convert_type(agate_table, loop.index0) -%}\n {%- set type = column_override.get(col_name, inferred_type) -%}\n {%- set column_name = (col_name | string) -%}\n {{ adapter.quote_seed_column(column_name, quote_seed_column) }} {{ type }} {%- if not loop.last -%}, {%- endif -%}\n {%- endfor -%}\n )\n {% endset %}\n\n {% call statement('_') -%}\n {{ sql }}\n {%- endcall %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5431883, "supported_languages": null}, "macro.dbt.reset_csv_table": {"name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.reset_csv_table", "macro_sql": "{% macro reset_csv_table(model, full_refresh, old_relation, agate_table) -%}\n {{ adapter.dispatch('reset_csv_table', 'dbt')(model, full_refresh, old_relation, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__reset_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5436547, "supported_languages": null}, "macro.dbt.default__reset_csv_table": {"name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__reset_csv_table", "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation.render() %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_csv_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5446405, "supported_languages": null}, "macro.dbt.get_csv_sql": {"name": "get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_csv_sql", "macro_sql": "{% macro get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ adapter.dispatch('get_csv_sql', 'dbt')(create_or_truncate_sql, insert_sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_csv_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5450444, "supported_languages": null}, "macro.dbt.default__get_csv_sql": {"name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_csv_sql", "macro_sql": "{% macro default__get_csv_sql(create_or_truncate_sql, insert_sql) %}\n {{ create_or_truncate_sql }};\n -- dbt seed --\n {{ insert_sql }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5453176, "supported_languages": null}, "macro.dbt.get_binding_char": {"name": "get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_binding_char", "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5456028, "supported_languages": null}, "macro.dbt.default__get_binding_char": {"name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_binding_char", "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.54587, "supported_languages": null}, "macro.dbt.get_batch_size": {"name": "get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_batch_size", "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_batch_size"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5462027, "supported_languages": null}, "macro.dbt.default__get_batch_size": {"name": "default__get_batch_size", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__get_batch_size", "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5464416, "supported_languages": null}, "macro.dbt.get_seed_column_quoted_csv": {"name": "get_seed_column_quoted_csv", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.get_seed_column_quoted_csv", "macro_sql": "{% macro get_seed_column_quoted_csv(model, column_names) %}\n {%- set quote_seed_column = model['config'].get('quote_columns', None) -%}\n {% set quoted = [] %}\n {% for col in column_names -%}\n {%- do quoted.append(adapter.quote_seed_column(col, quote_seed_column)) -%}\n {%- endfor %}\n\n {%- set dest_cols_csv = quoted | join(', ') -%}\n {{ return(dest_cols_csv) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.547396, "supported_languages": null}, "macro.dbt.load_csv_rows": {"name": "load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.load_csv_rows", "macro_sql": "{% macro load_csv_rows(model, agate_table) -%}\n {{ adapter.dispatch('load_csv_rows', 'dbt')(model, agate_table) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__load_csv_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5478985, "supported_languages": null}, "macro.dbt.default__load_csv_rows": {"name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/materializations/seeds/helpers.sql", "original_file_path": "macros/materializations/seeds/helpers.sql", "unique_id": "macro.dbt.default__load_csv_rows", "macro_sql": "{% macro default__load_csv_rows(model, agate_table) %}\n\n {% set batch_size = get_batch_size() %}\n\n {% set cols_sql = get_seed_column_quoted_csv(model, agate_table.column_names) %}\n {% set bindings = [] %}\n\n {% set statements = [] %}\n\n {% for chunk in agate_table.rows | batch(batch_size) %}\n {% set bindings = [] %}\n\n {% for row in chunk %}\n {% do bindings.extend(row) %}\n {% endfor %}\n\n {% set sql %}\n insert into {{ this.render() }} ({{ cols_sql }}) values\n {% for row in chunk -%}\n ({%- for column in agate_table.column_names -%}\n {{ get_binding_char() }}\n {%- if not loop.last%},{%- endif %}\n {%- endfor -%})\n {%- if not loop.last%},{%- endif %}\n {%- endfor %}\n {% endset %}\n\n {% do adapter.add_query(sql, bindings=bindings, abridge_sql_log=True) %}\n\n {% if loop.index0 == 0 %}\n {% do statements.append(sql) %}\n {% endif %}\n {% endfor %}\n\n {# Return SQL so we can render it out into the compiled files #}\n {{ return(statements[0]) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_batch_size", "macro.dbt.get_seed_column_quoted_csv", "macro.dbt.get_binding_char"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5503192, "supported_languages": null}, "macro.dbt.get_drop_backup_sql": {"name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.get_drop_backup_sql", "macro_sql": "{%- macro get_drop_backup_sql(relation) -%}\n {{- log('Applying DROP BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5509856, "supported_languages": null}, "macro.dbt.default__get_drop_backup_sql": {"name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop_backup.sql", "original_file_path": "macros/relations/drop_backup.sql", "unique_id": "macro.dbt.default__get_drop_backup_sql", "macro_sql": "{%- macro default__get_drop_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n {{ get_drop_sql(backup_relation) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.551419, "supported_languages": null}, "macro.dbt.get_create_intermediate_sql": {"name": "get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.get_create_intermediate_sql", "macro_sql": "{%- macro get_create_intermediate_sql(relation, sql) -%}\n {{- log('Applying CREATE INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_intermediate_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5521076, "supported_languages": null}, "macro.dbt.default__get_create_intermediate_sql": {"name": "default__get_create_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_intermediate.sql", "original_file_path": "macros/relations/create_intermediate.sql", "unique_id": "macro.dbt.default__get_create_intermediate_sql", "macro_sql": "{%- macro default__get_create_intermediate_sql(relation, sql) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n -- drop any pre-existing intermediate\n {{ get_drop_sql(intermediate_relation) }};\n\n {{ get_create_sql(intermediate_relation, sql) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5526087, "supported_languages": null}, "macro.dbt.get_replace_sql": {"name": "get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.get_replace_sql", "macro_sql": "{% macro get_replace_sql(existing_relation, target_relation, sql) %}\n {{- log('Applying REPLACE to: ' ~ existing_relation) -}}\n {{- adapter.dispatch('get_replace_sql', 'dbt')(existing_relation, target_relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5536602, "supported_languages": null}, "macro.dbt.default__get_replace_sql": {"name": "default__get_replace_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/replace.sql", "original_file_path": "macros/relations/replace.sql", "unique_id": "macro.dbt.default__get_replace_sql", "macro_sql": "{% macro default__get_replace_sql(existing_relation, target_relation, sql) %}\n\n {# /* use a create or replace statement if possible */ #}\n\n {% set is_replaceable = existing_relation.type == target_relation.type and existing_relation.can_be_replaced %}\n\n {% if is_replaceable and existing_relation.is_view %}\n {{ get_replace_view_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_table %}\n {{ get_replace_table_sql(target_relation, sql) }}\n\n {% elif is_replaceable and existing_relation.is_materialized_view %}\n {{ get_replace_materialized_view_sql(target_relation, sql) }}\n\n {# /* a create or replace statement is not possible, so try to stage and/or backup to be safe */ #}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one using a backup */ #}\n {%- elif target_relation.can_be_renamed and existing_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* create target_relation as an intermediate relation, then swap it out with the existing one without using a backup */ #}\n {%- elif target_relation.can_be_renamed -%}\n {{ get_create_intermediate_sql(target_relation, sql) }};\n {{ get_drop_sql(existing_relation) }};\n {{ get_rename_intermediate_sql(target_relation) }}\n\n {# /* create target_relation in place by first backing up the existing relation */ #}\n {%- elif existing_relation.can_be_renamed -%}\n {{ get_create_backup_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }};\n {{ get_drop_backup_sql(existing_relation) }}\n\n {# /* no renaming is allowed, so just drop and create */ #}\n {%- else -%}\n {{ get_drop_sql(existing_relation) }};\n {{ get_create_sql(target_relation, sql) }}\n\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_replace_view_sql", "macro.dbt.get_replace_table_sql", "macro.dbt.get_replace_materialized_view_sql", "macro.dbt.get_create_intermediate_sql", "macro.dbt.get_create_backup_sql", "macro.dbt.get_rename_intermediate_sql", "macro.dbt.get_drop_backup_sql", "macro.dbt.get_drop_sql", "macro.dbt.get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5560462, "supported_languages": null}, "macro.dbt.get_rename_intermediate_sql": {"name": "get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.get_rename_intermediate_sql", "macro_sql": "{%- macro get_rename_intermediate_sql(relation) -%}\n {{- log('Applying RENAME INTERMEDIATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_intermediate_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_intermediate_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.556648, "supported_languages": null}, "macro.dbt.default__get_rename_intermediate_sql": {"name": "default__get_rename_intermediate_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename_intermediate.sql", "original_file_path": "macros/relations/rename_intermediate.sql", "unique_id": "macro.dbt.default__get_rename_intermediate_sql", "macro_sql": "{%- macro default__get_rename_intermediate_sql(relation) -%}\n\n -- get the standard intermediate name\n {% set intermediate_relation = make_intermediate_relation(relation) %}\n\n {{ get_rename_sql(intermediate_relation, relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_intermediate_relation", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.557099, "supported_languages": null}, "macro.dbt.get_drop_sql": {"name": "get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.get_drop_sql", "macro_sql": "{%- macro get_drop_sql(relation) -%}\n {{- log('Applying DROP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_drop_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.557967, "supported_languages": null}, "macro.dbt.default__get_drop_sql": {"name": "default__get_drop_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__get_drop_sql", "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation.render() }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.drop_view", "macro.dbt.drop_table", "macro.dbt.drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5587208, "supported_languages": null}, "macro.dbt.drop_relation": {"name": "drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation", "macro_sql": "{% macro drop_relation(relation) -%}\n {{ return(adapter.dispatch('drop_relation', 'dbt')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5591133, "supported_languages": null}, "macro.dbt.default__drop_relation": {"name": "default__drop_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.default__drop_relation", "macro_sql": "{% macro default__drop_relation(relation) -%}\n {% call statement('drop_relation', auto_begin=False) -%}\n {{ get_drop_sql(relation) }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.get_drop_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5595264, "supported_languages": null}, "macro.dbt.drop_relation_if_exists": {"name": "drop_relation_if_exists", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/drop.sql", "original_file_path": "macros/relations/drop.sql", "unique_id": "macro.dbt.drop_relation_if_exists", "macro_sql": "{% macro drop_relation_if_exists(relation) %}\n {% if relation is not none %}\n {{ adapter.drop_relation(relation) }}\n {% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5599496, "supported_languages": null}, "macro.dbt.drop_schema_named": {"name": "drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.drop_schema_named", "macro_sql": "{% macro drop_schema_named(schema_name) %}\n {{ return(adapter.dispatch('drop_schema_named', 'dbt') (schema_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__drop_schema_named"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.560468, "supported_languages": null}, "macro.dbt.default__drop_schema_named": {"name": "default__drop_schema_named", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/schema.sql", "original_file_path": "macros/relations/schema.sql", "unique_id": "macro.dbt.default__drop_schema_named", "macro_sql": "{% macro default__drop_schema_named(schema_name) %}\n {% set schema_relation = api.Relation.create(schema=schema_name) %}\n {{ adapter.drop_schema(schema_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5609155, "supported_languages": null}, "macro.dbt.get_create_backup_sql": {"name": "get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.get_create_backup_sql", "macro_sql": "{%- macro get_create_backup_sql(relation) -%}\n {{- log('Applying CREATE BACKUP to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_backup_sql', 'dbt')(relation) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_backup_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5616386, "supported_languages": null}, "macro.dbt.default__get_create_backup_sql": {"name": "default__get_create_backup_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create_backup.sql", "original_file_path": "macros/relations/create_backup.sql", "unique_id": "macro.dbt.default__get_create_backup_sql", "macro_sql": "{%- macro default__get_create_backup_sql(relation) -%}\n\n -- get the standard backup name\n {% set backup_relation = make_backup_relation(relation, relation.type) %}\n\n -- drop any pre-existing backup\n {{ get_drop_sql(backup_relation) }};\n\n {{ get_rename_sql(relation, backup_relation.identifier) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.make_backup_relation", "macro.dbt.get_drop_sql", "macro.dbt.get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.562211, "supported_languages": null}, "macro.dbt.get_rename_sql": {"name": "get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.get_rename_sql", "macro_sql": "{%- macro get_rename_sql(relation, new_name) -%}\n {{- log('Applying RENAME to: ' ~ relation) -}}\n {{- adapter.dispatch('get_rename_sql', 'dbt')(relation, new_name) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_rename_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5631196, "supported_languages": null}, "macro.dbt.default__get_rename_sql": {"name": "default__get_rename_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__get_rename_sql", "macro_sql": "{%- macro default__get_rename_sql(relation, new_name) -%}\n\n {%- if relation.is_view -%}\n {{ get_rename_view_sql(relation, new_name) }}\n\n {%- elif relation.is_table -%}\n {{ get_rename_table_sql(relation, new_name) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_rename_materialized_view_sql(relation, new_name) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_rename_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.get_rename_view_sql", "macro.dbt.get_rename_table_sql", "macro.dbt.get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5639946, "supported_languages": null}, "macro.dbt.rename_relation": {"name": "rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.rename_relation", "macro_sql": "{% macro rename_relation(from_relation, to_relation) -%}\n {{ return(adapter.dispatch('rename_relation', 'dbt')(from_relation, to_relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__rename_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5644004, "supported_languages": null}, "macro.dbt.default__rename_relation": {"name": "default__rename_relation", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/rename.sql", "original_file_path": "macros/relations/rename.sql", "unique_id": "macro.dbt.default__rename_relation", "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation.render() }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5650187, "supported_languages": null}, "macro.dbt.get_create_sql": {"name": "get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.get_create_sql", "macro_sql": "{%- macro get_create_sql(relation, sql) -%}\n {{- log('Applying CREATE to: ' ~ relation) -}}\n {{- adapter.dispatch('get_create_sql', 'dbt')(relation, sql) -}}\n{%- endmacro -%}\n\n\n", "depends_on": {"macros": ["macro.dbt.default__get_create_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.565737, "supported_languages": null}, "macro.dbt.default__get_create_sql": {"name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/create.sql", "original_file_path": "macros/relations/create.sql", "unique_id": "macro.dbt.default__get_create_sql", "macro_sql": "{%- macro default__get_create_sql(relation, sql) -%}\n\n {%- if relation.is_view -%}\n {{ get_create_view_as_sql(relation, sql) }}\n\n {%- elif relation.is_table -%}\n {{ get_create_table_as_sql(False, relation, sql) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ get_create_materialized_view_as_sql(relation, sql) }}\n\n {%- else -%}\n {{- exceptions.raise_compiler_error(\"`get_create_sql` has not been implemented for: \" ~ relation.type ) -}}\n\n {%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.get_create_view_as_sql", "macro.dbt.get_create_table_as_sql", "macro.dbt.get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5667849, "supported_languages": null}, "macro.dbt.get_replace_materialized_view_sql": {"name": "get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.get_replace_materialized_view_sql", "macro_sql": "{% macro get_replace_materialized_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_replace_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5674663, "supported_languages": null}, "macro.dbt.default__get_replace_materialized_view_sql": {"name": "default__get_replace_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/replace.sql", "original_file_path": "macros/relations/materialized_view/replace.sql", "unique_id": "macro.dbt.default__get_replace_materialized_view_sql", "macro_sql": "{% macro default__get_replace_materialized_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5677934, "supported_languages": null}, "macro.dbt.drop_materialized_view": {"name": "drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.drop_materialized_view", "macro_sql": "{% macro drop_materialized_view(relation) -%}\n {{- adapter.dispatch('drop_materialized_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5683055, "supported_languages": null}, "macro.dbt.default__drop_materialized_view": {"name": "default__drop_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/drop.sql", "original_file_path": "macros/relations/materialized_view/drop.sql", "unique_id": "macro.dbt.default__drop_materialized_view", "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.568561, "supported_languages": null}, "macro.dbt.refresh_materialized_view": {"name": "refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.refresh_materialized_view", "macro_sql": "{% macro refresh_materialized_view(relation) %}\n {{- log('Applying REFRESH to: ' ~ relation) -}}\n {{- adapter.dispatch('refresh_materialized_view', 'dbt')(relation) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__refresh_materialized_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5691614, "supported_languages": null}, "macro.dbt.default__refresh_materialized_view": {"name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/refresh.sql", "original_file_path": "macros/relations/materialized_view/refresh.sql", "unique_id": "macro.dbt.default__refresh_materialized_view", "macro_sql": "{% macro default__refresh_materialized_view(relation) %}\n {{ exceptions.raise_compiler_error(\"`refresh_materialized_view` has not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.569448, "supported_languages": null}, "macro.dbt.get_rename_materialized_view_sql": {"name": "get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.get_rename_materialized_view_sql", "macro_sql": "{% macro get_rename_materialized_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_materialized_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_materialized_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5699894, "supported_languages": null}, "macro.dbt.default__get_rename_materialized_view_sql": {"name": "default__get_rename_materialized_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/rename.sql", "original_file_path": "macros/relations/materialized_view/rename.sql", "unique_id": "macro.dbt.default__get_rename_materialized_view_sql", "macro_sql": "{% macro default__get_rename_materialized_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_materialized_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5702953, "supported_languages": null}, "macro.dbt.get_create_materialized_view_as_sql": {"name": "get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.get_create_materialized_view_as_sql", "macro_sql": "{% macro get_create_materialized_view_as_sql(relation, sql) -%}\n {{- adapter.dispatch('get_create_materialized_view_as_sql', 'dbt')(relation, sql) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_create_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5708938, "supported_languages": null}, "macro.dbt.default__get_create_materialized_view_as_sql": {"name": "default__get_create_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/create.sql", "original_file_path": "macros/relations/materialized_view/create.sql", "unique_id": "macro.dbt.default__get_create_materialized_view_as_sql", "macro_sql": "{% macro default__get_create_materialized_view_as_sql(relation, sql) -%}\n {{ exceptions.raise_compiler_error(\n \"`get_create_materialized_view_as_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5713165, "supported_languages": null}, "macro.dbt.get_alter_materialized_view_as_sql": {"name": "get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_alter_materialized_view_as_sql", "macro_sql": "{% macro get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{- log('Applying ALTER to: ' ~ relation) -}}\n {{- adapter.dispatch('get_alter_materialized_view_as_sql', 'dbt')(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n ) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5723305, "supported_languages": null}, "macro.dbt.default__get_alter_materialized_view_as_sql": {"name": "default__get_alter_materialized_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_alter_materialized_view_as_sql", "macro_sql": "{% macro default__get_alter_materialized_view_as_sql(\n relation,\n configuration_changes,\n sql,\n existing_relation,\n backup_relation,\n intermediate_relation\n) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5727122, "supported_languages": null}, "macro.dbt.get_materialized_view_configuration_changes": {"name": "get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.get_materialized_view_configuration_changes", "macro_sql": "{% macro get_materialized_view_configuration_changes(existing_relation, new_config) %}\n /* {#\n It's recommended that configuration changes be formatted as follows:\n {\"\": [{\"action\": \"\", \"context\": ...}]}\n\n For example:\n {\n \"indexes\": [\n {\"action\": \"drop\", \"context\": \"index_abc\"},\n {\"action\": \"create\", \"context\": {\"columns\": [\"column_1\", \"column_2\"], \"type\": \"hash\", \"unique\": True}},\n ],\n }\n\n Either way, `get_materialized_view_configuration_changes` needs to align with `get_alter_materialized_view_as_sql`.\n #} */\n {{- log('Determining configuration changes on: ' ~ existing_relation) -}}\n {%- do return(adapter.dispatch('get_materialized_view_configuration_changes', 'dbt')(existing_relation, new_config)) -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_materialized_view_configuration_changes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5732944, "supported_languages": null}, "macro.dbt.default__get_materialized_view_configuration_changes": {"name": "default__get_materialized_view_configuration_changes", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/materialized_view/alter.sql", "original_file_path": "macros/relations/materialized_view/alter.sql", "unique_id": "macro.dbt.default__get_materialized_view_configuration_changes", "macro_sql": "{% macro default__get_materialized_view_configuration_changes(existing_relation, new_config) %}\n {{ exceptions.raise_compiler_error(\"Materialized views have not been implemented for this adapter.\") }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5735905, "supported_languages": null}, "macro.dbt.get_replace_view_sql": {"name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.get_replace_view_sql", "macro_sql": "{% macro get_replace_view_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_view_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.574594, "supported_languages": null}, "macro.dbt.default__get_replace_view_sql": {"name": "default__get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__get_replace_view_sql", "macro_sql": "{% macro default__get_replace_view_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5749383, "supported_languages": null}, "macro.dbt.create_or_replace_view": {"name": "create_or_replace_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.create_or_replace_view", "macro_sql": "{% macro create_or_replace_view() %}\n {%- set identifier = model['alias'] -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set target_relation = api.Relation.create(\n identifier=identifier, schema=schema, database=database,\n type='view') -%}\n {% set grant_config = config.get('grants') %}\n\n {{ run_hooks(pre_hooks) }}\n\n -- If there's a table with the same name and we weren't told to full refresh,\n -- that's an error. If we were told to full refresh, drop it. This behavior differs\n -- for Snowflake and BigQuery, so multiple dispatch is used.\n {%- if old_relation is not none and old_relation.is_table -%}\n {{ handle_existing_table(should_full_refresh(), old_relation) }}\n {%- endif -%}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_view_as_sql(target_relation, sql) }}\n {%- endcall %}\n\n {% set should_revoke = should_revoke(exists_as_view, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {{ run_hooks(post_hooks) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_hooks", "macro.dbt.handle_existing_table", "macro.dbt.should_full_refresh", "macro.dbt.statement", "macro.dbt.get_create_view_as_sql", "macro.dbt.should_revoke", "macro.dbt.apply_grants"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5772355, "supported_languages": null}, "macro.dbt.handle_existing_table": {"name": "handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.handle_existing_table", "macro_sql": "{% macro handle_existing_table(full_refresh, old_relation) %}\n {{ adapter.dispatch('handle_existing_table', 'dbt')(full_refresh, old_relation) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__handle_existing_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5776389, "supported_languages": null}, "macro.dbt.default__handle_existing_table": {"name": "default__handle_existing_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/replace.sql", "original_file_path": "macros/relations/view/replace.sql", "unique_id": "macro.dbt.default__handle_existing_table", "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation.render() ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5781438, "supported_languages": null}, "macro.dbt.drop_view": {"name": "drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.drop_view", "macro_sql": "{% macro drop_view(relation) -%}\n {{- adapter.dispatch('drop_view', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_view"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5786276, "supported_languages": null}, "macro.dbt.default__drop_view": {"name": "default__drop_view", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/drop.sql", "original_file_path": "macros/relations/view/drop.sql", "unique_id": "macro.dbt.default__drop_view", "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5789056, "supported_languages": null}, "macro.dbt.get_rename_view_sql": {"name": "get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.get_rename_view_sql", "macro_sql": "{% macro get_rename_view_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_view_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_view_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5794199, "supported_languages": null}, "macro.dbt.default__get_rename_view_sql": {"name": "default__get_rename_view_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/rename.sql", "original_file_path": "macros/relations/view/rename.sql", "unique_id": "macro.dbt.default__get_rename_view_sql", "macro_sql": "{% macro default__get_rename_view_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_view_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5797231, "supported_languages": null}, "macro.dbt.get_create_view_as_sql": {"name": "get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.get_create_view_as_sql", "macro_sql": "{% macro get_create_view_as_sql(relation, sql) -%}\n {{ adapter.dispatch('get_create_view_as_sql', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_view_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.580425, "supported_languages": null}, "macro.dbt.default__get_create_view_as_sql": {"name": "default__get_create_view_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__get_create_view_as_sql", "macro_sql": "{% macro default__get_create_view_as_sql(relation, sql) -%}\n {{ return(create_view_as(relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.580749, "supported_languages": null}, "macro.dbt.create_view_as": {"name": "create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.create_view_as", "macro_sql": "{% macro create_view_as(relation, sql) -%}\n {{ adapter.dispatch('create_view_as', 'dbt')(relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__create_view_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5812516, "supported_languages": null}, "macro.dbt.default__create_view_as": {"name": "default__create_view_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/view/create.sql", "original_file_path": "macros/relations/view/create.sql", "unique_id": "macro.dbt.default__create_view_as", "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation.render() }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5821486, "supported_languages": null}, "macro.dbt.get_replace_table_sql": {"name": "get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.get_replace_table_sql", "macro_sql": "{% macro get_replace_table_sql(relation, sql) %}\n {{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_replace_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.582674, "supported_languages": null}, "macro.dbt.default__get_replace_table_sql": {"name": "default__get_replace_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/replace.sql", "original_file_path": "macros/relations/table/replace.sql", "unique_id": "macro.dbt.default__get_replace_table_sql", "macro_sql": "{% macro default__get_replace_table_sql(relation, sql) %}\n {{ exceptions.raise_compiler_error(\n \"`get_replace_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5829935, "supported_languages": null}, "macro.dbt.drop_table": {"name": "drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.drop_table", "macro_sql": "{% macro drop_table(relation) -%}\n {{- adapter.dispatch('drop_table', 'dbt')(relation) -}}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__drop_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5834582, "supported_languages": null}, "macro.dbt.default__drop_table": {"name": "default__drop_table", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/drop.sql", "original_file_path": "macros/relations/table/drop.sql", "unique_id": "macro.dbt.default__drop_table", "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation.render() }} cascade\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.583708, "supported_languages": null}, "macro.dbt.get_rename_table_sql": {"name": "get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.get_rename_table_sql", "macro_sql": "{% macro get_rename_table_sql(relation, new_name) %}\n {{- adapter.dispatch('get_rename_table_sql', 'dbt')(relation, new_name) -}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__get_rename_table_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5842383, "supported_languages": null}, "macro.dbt.default__get_rename_table_sql": {"name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/rename.sql", "original_file_path": "macros/relations/table/rename.sql", "unique_id": "macro.dbt.default__get_rename_table_sql", "macro_sql": "{% macro default__get_rename_table_sql(relation, new_name) %}\n {{ exceptions.raise_compiler_error(\n \"`get_rename_table_sql` has not been implemented for this adapter.\"\n ) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5845358, "supported_languages": null}, "macro.dbt.get_create_table_as_sql": {"name": "get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_create_table_as_sql", "macro_sql": "{% macro get_create_table_as_sql(temporary, relation, sql) -%}\n {{ adapter.dispatch('get_create_table_as_sql', 'dbt')(temporary, relation, sql) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_create_table_as_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5857027, "supported_languages": null}, "macro.dbt.default__get_create_table_as_sql": {"name": "default__get_create_table_as_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_create_table_as_sql", "macro_sql": "{% macro default__get_create_table_as_sql(temporary, relation, sql) -%}\n {{ return(create_table_as(temporary, relation, sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.586093, "supported_languages": null}, "macro.dbt.create_table_as": {"name": "create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.create_table_as", "macro_sql": "{% macro create_table_as(temporary, relation, compiled_code, language='sql') -%}\n {# backward compatibility for create_table_as that does not support language #}\n {% if language == \"sql\" %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code)}}\n {% else %}\n {{ adapter.dispatch('create_table_as', 'dbt')(temporary, relation, compiled_code, language) }}\n {% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_postgres.postgres__create_table_as"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5869503, "supported_languages": null}, "macro.dbt.default__create_table_as": {"name": "default__create_table_as", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__create_table_as", "macro_sql": "{% macro default__create_table_as(temporary, relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n\n create {% if temporary: -%}temporary{%- endif %} table\n {{ relation.include(database=(not temporary), schema=(not temporary)) }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced and (not temporary) %}\n {{ get_assert_columns_equivalent(sql) }}\n {{ get_table_columns_and_constraints() }}\n {%- set sql = get_select_subquery(sql) %}\n {% endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.get_assert_columns_equivalent", "macro.dbt.get_table_columns_and_constraints", "macro.dbt.get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.588339, "supported_languages": null}, "macro.dbt.default__get_column_names": {"name": "default__get_column_names", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_column_names", "macro_sql": "{% macro default__get_column_names() %}\n {#- loop through user_provided_columns to get column names -#}\n {%- set user_provided_columns = model['columns'] -%}\n {%- for i in user_provided_columns %}\n {%- set col = user_provided_columns[i] -%}\n {%- set col_name = adapter.quote(col['name']) if col.get('quote') else col['name'] -%}\n {{ col_name }}{{ \", \" if not loop.last }}\n {%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.589283, "supported_languages": null}, "macro.dbt.get_select_subquery": {"name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.get_select_subquery", "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_select_subquery"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.589656, "supported_languages": null}, "macro.dbt.default__get_select_subquery": {"name": "default__get_select_subquery", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/table/create.sql", "original_file_path": "macros/relations/table/create.sql", "unique_id": "macro.dbt.default__get_select_subquery", "macro_sql": "{% macro default__get_select_subquery(sql) %}\n select {{ adapter.dispatch('get_column_names', 'dbt')() }}\n from (\n {{ sql }}\n ) as model_subq\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__get_column_names"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.590036, "supported_languages": null}, "macro.dbt.get_table_columns_and_constraints": {"name": "get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_table_columns_and_constraints", "macro_sql": "{%- macro get_table_columns_and_constraints() -%}\n {{ adapter.dispatch('get_table_columns_and_constraints', 'dbt')() }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5914288, "supported_languages": null}, "macro.dbt.default__get_table_columns_and_constraints": {"name": "default__get_table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_table_columns_and_constraints", "macro_sql": "{% macro default__get_table_columns_and_constraints() -%}\n {{ return(table_columns_and_constraints()) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.table_columns_and_constraints"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5916836, "supported_languages": null}, "macro.dbt.table_columns_and_constraints": {"name": "table_columns_and_constraints", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.table_columns_and_constraints", "macro_sql": "{% macro table_columns_and_constraints() %}\n {# loop through user_provided_columns to create DDL with data types and constraints #}\n {%- set raw_column_constraints = adapter.render_raw_columns_constraints(raw_columns=model['columns']) -%}\n {%- set raw_model_constraints = adapter.render_raw_model_constraints(raw_constraints=model['constraints']) -%}\n (\n {% for c in raw_column_constraints -%}\n {{ c }}{{ \",\" if not loop.last or raw_model_constraints }}\n {% endfor %}\n {% for c in raw_model_constraints -%}\n {{ c }}{{ \",\" if not loop.last }}\n {% endfor -%}\n )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5928993, "supported_languages": null}, "macro.dbt.get_assert_columns_equivalent": {"name": "get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.get_assert_columns_equivalent", "macro_sql": "\n\n{%- macro get_assert_columns_equivalent(sql) -%}\n {{ adapter.dispatch('get_assert_columns_equivalent', 'dbt')(sql) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__get_assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5932462, "supported_languages": null}, "macro.dbt.default__get_assert_columns_equivalent": {"name": "default__get_assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__get_assert_columns_equivalent", "macro_sql": "{% macro default__get_assert_columns_equivalent(sql) -%}\n {{ return(assert_columns_equivalent(sql)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.assert_columns_equivalent"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5935338, "supported_languages": null}, "macro.dbt.assert_columns_equivalent": {"name": "assert_columns_equivalent", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.assert_columns_equivalent", "macro_sql": "{% macro assert_columns_equivalent(sql) %}\n\n {#-- First ensure the user has defined 'columns' in yaml specification --#}\n {%- set user_defined_columns = model['columns'] -%}\n {%- if not user_defined_columns -%}\n {{ exceptions.raise_contract_error([], []) }}\n {%- endif -%}\n\n {#-- Obtain the column schema provided by sql file. #}\n {%- set sql_file_provided_columns = get_column_schema_from_query(sql, config.get('sql_header', none)) -%}\n {#--Obtain the column schema provided by the schema file by generating an 'empty schema' query from the model's columns. #}\n {%- set schema_file_provided_columns = get_column_schema_from_query(get_empty_schema_sql(user_defined_columns)) -%}\n\n {#-- create dictionaries with name and formatted data type and strings for exception #}\n {%- set sql_columns = format_columns(sql_file_provided_columns) -%}\n {%- set yaml_columns = format_columns(schema_file_provided_columns) -%}\n\n {%- if sql_columns|length != yaml_columns|length -%}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n\n {%- for sql_col in sql_columns -%}\n {%- set yaml_col = [] -%}\n {%- for this_col in yaml_columns -%}\n {%- if this_col['name'] == sql_col['name'] -%}\n {%- do yaml_col.append(this_col) -%}\n {%- break -%}\n {%- endif -%}\n {%- endfor -%}\n {%- if not yaml_col -%}\n {#-- Column with name not found in yaml #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- if sql_col['formatted'] != yaml_col[0]['formatted'] -%}\n {#-- Column data types don't match #}\n {%- do exceptions.raise_contract_error(yaml_columns, sql_columns) -%}\n {%- endif -%}\n {%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.get_column_schema_from_query", "macro.dbt.get_empty_schema_sql", "macro.dbt.format_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5960748, "supported_languages": null}, "macro.dbt.format_columns": {"name": "format_columns", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.format_columns", "macro_sql": "{% macro format_columns(columns) %}\n {% set formatted_columns = [] %}\n {% for column in columns %}\n {%- set formatted_column = adapter.dispatch('format_column', 'dbt')(column) -%}\n {%- do formatted_columns.append(formatted_column) -%}\n {% endfor %}\n {{ return(formatted_columns) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__format_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5968459, "supported_languages": null}, "macro.dbt.default__format_column": {"name": "default__format_column", "resource_type": "macro", "package_name": "dbt", "path": "macros/relations/column/columns_spec_ddl.sql", "original_file_path": "macros/relations/column/columns_spec_ddl.sql", "unique_id": "macro.dbt.default__format_column", "macro_sql": "{% macro default__format_column(column) -%}\n {% set data_type = column.dtype %}\n {% set formatted = column.column.lower() ~ \" \" ~ data_type %}\n {{ return({'name': column.name, 'data_type': data_type, 'formatted': formatted}) }}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5975223, "supported_languages": null}, "macro.dbt.generate_database_name": {"name": "generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.generate_database_name", "macro_sql": "{% macro generate_database_name(custom_database_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_database_name', 'dbt')(custom_database_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_database_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.59836, "supported_languages": null}, "macro.dbt.default__generate_database_name": {"name": "default__generate_database_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_database.sql", "original_file_path": "macros/get_custom_name/get_custom_database.sql", "unique_id": "macro.dbt.default__generate_database_name", "macro_sql": "{% macro default__generate_database_name(custom_database_name=none, node=none) -%}\n {%- set default_database = target.database -%}\n {%- if node is not none and node|attr('database') -%}\n {%- set catalog_relation = adapter.build_catalog_relation(node) -%}\n {%- if catalog_relation and catalog_relation|attr('catalog_database') -%}\n {{ return(catalog_relation.catalog_database) }}\n {%- endif -%}\n {%- endif -%}\n {%- if custom_database_name is none -%}\n\n {{ default_database }}\n\n {%- else -%}\n\n {{ custom_database_name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.5994425, "supported_languages": null}, "macro.dbt.generate_schema_name": {"name": "generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name", "macro_sql": "{% macro generate_schema_name(custom_schema_name=none, node=none) -%}\n {{ return(adapter.dispatch('generate_schema_name', 'dbt')(custom_schema_name, node)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_schema_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6003766, "supported_languages": null}, "macro.dbt.default__generate_schema_name": {"name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.default__generate_schema_name", "macro_sql": "{% macro default__generate_schema_name(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if custom_schema_name is none -%}\n\n {{ default_schema }}\n\n {%- else -%}\n\n {{ default_schema }}_{{ custom_schema_name | trim }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6009371, "supported_languages": null}, "macro.dbt.generate_schema_name_for_env": {"name": "generate_schema_name_for_env", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_schema.sql", "original_file_path": "macros/get_custom_name/get_custom_schema.sql", "unique_id": "macro.dbt.generate_schema_name_for_env", "macro_sql": "{% macro generate_schema_name_for_env(custom_schema_name, node) -%}\n\n {%- set default_schema = target.schema -%}\n {%- if target.name == 'prod' and custom_schema_name is not none -%}\n\n {{ custom_schema_name | trim }}\n\n {%- else -%}\n\n {{ default_schema }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6015055, "supported_languages": null}, "macro.dbt.generate_latest_version_pointer_alias": {"name": "generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.generate_latest_version_pointer_alias", "macro_sql": "{% macro generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_latest_version_pointer_alias', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_latest_version_pointer_alias"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.602232, "supported_languages": null}, "macro.dbt.default__generate_latest_version_pointer_alias": {"name": "default__generate_latest_version_pointer_alias", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "original_file_path": "macros/get_custom_name/get_latest_version_pointer_alias.sql", "unique_id": "macro.dbt.default__generate_latest_version_pointer_alias", "macro_sql": "{% macro default__generate_latest_version_pointer_alias(custom_alias_name=none, node=none) -%}\n {%- if custom_alias_name -%}\n {{ custom_alias_name | trim }}\n {%- else -%}\n {{ node.name }}\n {%- endif -%}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6026773, "supported_languages": null}, "macro.dbt.generate_alias_name": {"name": "generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.generate_alias_name", "macro_sql": "{% macro generate_alias_name(custom_alias_name=none, node=none) -%}\n {% do return(adapter.dispatch('generate_alias_name', 'dbt')(custom_alias_name, node)) %}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.default__generate_alias_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.603409, "supported_languages": null}, "macro.dbt.default__generate_alias_name": {"name": "default__generate_alias_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/get_custom_name/get_custom_alias.sql", "original_file_path": "macros/get_custom_name/get_custom_alias.sql", "unique_id": "macro.dbt.default__generate_alias_name", "macro_sql": "{% macro default__generate_alias_name(custom_alias_name=none, node=none) -%}\n\n {%- if custom_alias_name -%}\n\n {{ custom_alias_name | trim }}\n\n {%- elif node.version -%}\n\n {{ return(node.name ~ \"_v\" ~ (node.version | replace(\".\", \"_\"))) }}\n\n {%- else -%}\n\n {{ node.name }}\n\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6041849, "supported_languages": null}, "macro.dbt.resolve_model_name": {"name": "resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.resolve_model_name", "macro_sql": "{% macro resolve_model_name(input_model_name) %}\n {{ return(adapter.dispatch('resolve_model_name', 'dbt')(input_model_name)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.default__resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6057034, "supported_languages": null}, "macro.dbt.default__resolve_model_name": {"name": "default__resolve_model_name", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.default__resolve_model_name", "macro_sql": "\n\n{%- macro default__resolve_model_name(input_model_name) -%}\n {{ input_model_name | string | replace('\"', '\\\"') }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6060457, "supported_languages": null}, "macro.dbt.build_ref_function": {"name": "build_ref_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_ref_function", "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n\n {#\n We want to get the string of the returned relation by calling .render() in order to skip sample/empty\n mode rendering logic. However, people override the default ref macro, and often return a string instead\n of a relation (like the ref macro does by default). Thus, to make sure we dont blow things up, we have\n to ensure the resolved relation has a .render() method.\n #}\n {%- if resolved.render is defined and resolved.render is callable -%}\n {%- set resolved = resolved.render() -%}\n {%- endif -%}\n\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6087763, "supported_languages": null}, "macro.dbt.build_source_function": {"name": "build_source_function", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_source_function", "macro_sql": "{% macro build_source_function(model) %}\n\n {%- set source_dict = {} -%}\n {%- for _source in model.sources -%}\n {%- set resolved = source(*_source) -%}\n {%- do source_dict.update({_source | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef source(*args, dbt_load_df_function):\n sources = {{ source_dict | tojson }}\n key = '.'.join(args)\n return dbt_load_df_function(sources[key])\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.resolve_model_name"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6096237, "supported_languages": null}, "macro.dbt.build_config_dict": {"name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.build_config_dict", "macro_sql": "{% macro build_config_dict(model) %}\n {%- set config_dict = {} -%}\n {% set config_dbt_used = zip(model.config.config_keys_used, model.config.config_keys_defaults) | list %}\n {%- for key, default in config_dbt_used -%}\n {# weird type testing with enum, would be much easier to write this logic in Python! #}\n {%- if key == \"language\" -%}\n {%- set value = \"python\" -%}\n {%- endif -%}\n {%- set value = model.config.get(key, default) -%}\n {%- do config_dict.update({key: value}) -%}\n {%- endfor -%}\n {# Handle dbt.config.meta_get() calls - use separate dict to avoid overwriting native configs #}\n {%- set meta_dict = {} -%}\n {%- if model.config.meta_keys_used -%}\n {% set meta_dbt_used = zip(model.config.meta_keys_used, model.config.meta_keys_defaults) | list %}\n {%- for key, default in meta_dbt_used -%}\n {%- if model.config.meta and key in model.config.meta -%}\n {%- set value = model.config.meta[key] -%}\n {%- else -%}\n {%- set value = default -%}\n {%- endif -%}\n {%- do meta_dict.update({key: value}) -%}\n {%- endfor -%}\n {%- endif -%}\nconfig_dict = {{ config_dict }}\nmeta_dict = {{ meta_dict }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6118717, "supported_languages": null}, "macro.dbt.py_script_postfix": {"name": "py_script_postfix", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_postfix", "macro_sql": "{% macro py_script_postfix(model) %}\n# This part is user provided model code\n# you will need to copy the next section to run the code\n# COMMAND ----------\n# this part is dbt logic for get ref work, do not modify\n\n{{ build_ref_function(model ) }}\n{{ build_source_function(model ) }}\n{{ build_config_dict(model) }}\n\nclass config:\n def __init__(self, *args, **kwargs):\n pass\n\n @staticmethod\n def get(key, default=None):\n return config_dict.get(key, default)\n\n @staticmethod\n def meta_get(key, default=None):\n return meta_dict.get(key, default)\n\nclass this:\n \"\"\"dbt.this() or dbt.this.identifier\"\"\"\n database = \"{{ this.database }}\"\n schema = \"{{ this.schema }}\"\n identifier = \"{{ this.identifier }}\"\n {% set this_relation_name = resolve_model_name(this) %}\n def __repr__(self):\n return '{{ this_relation_name }}'\n\n\nclass dbtObj:\n def __init__(self, load_df_function) -> None:\n self.source = lambda *args: source(*args, dbt_load_df_function=load_df_function)\n self.ref = lambda *args, **kwargs: ref(*args, **kwargs, dbt_load_df_function=load_df_function)\n self.config = config\n self.this = this()\n self.is_incremental = {{ is_incremental() }}\n\n# COMMAND ----------\n{{py_script_comment()}}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.build_ref_function", "macro.dbt.build_source_function", "macro.dbt.build_config_dict", "macro.dbt.resolve_model_name", "macro.dbt.is_incremental", "macro.dbt.py_script_comment"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6128058, "supported_languages": null}, "macro.dbt.py_script_comment": {"name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", "path": "macros/python_model/python.sql", "original_file_path": "macros/python_model/python.sql", "unique_id": "macro.dbt.py_script_comment", "macro_sql": "{%macro py_script_comment()%}\n{%endmacro%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6129904, "supported_languages": null}, "macro.dbt.get_fixture_sql": {"name": "get_fixture_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_fixture_sql", "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- set column_name_to_quoted = {} -%}\n{%- for column in columns_in_relation -%}\n\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- do column_name_to_quoted.update({column.name|lower: column.quoted}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ validate_fixture_rows(rows, row_number) }}\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.load_relation", "macro.dbt.safe_cast", "macro.dbt.validate_fixture_rows", "macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6180172, "supported_languages": null}, "macro.dbt.get_expected_sql": {"name": "get_expected_sql", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.get_expected_sql", "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types, column_name_to_quoted) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name_to_quoted[column_name] }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.format_row"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6193018, "supported_languages": null}, "macro.dbt.format_row": {"name": "format_row", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.format_row", "macro_sql": "\n\n{%- macro format_row(row, column_name_to_data_types) -%}\n {#-- generate case-insensitive formatted row --#}\n {% set formatted_row = {} %}\n {%- for column_name, column_value in row.items() -%}\n {% set column_name = column_name|lower %}\n\n {%- if column_name not in column_name_to_data_types %}\n {#-- if user-provided row contains column name that relation does not contain, raise an error --#}\n {% set fixture_name = \"expected output\" if model.resource_type == 'unit_test' else (\"'\" ~ model.name ~ \"'\") %}\n {{ exceptions.raise_compiler_error(\n \"Invalid column name: '\" ~ column_name ~ \"' in unit test fixture for \" ~ fixture_name ~ \".\"\n \"\\nAccepted columns for \" ~ fixture_name ~ \" are: \" ~ (column_name_to_data_types.keys()|list)\n ) }}\n {%- endif -%}\n\n {%- set column_type = column_name_to_data_types[column_name] %}\n\n {#-- For string fixture values, strip varchar length to prevent silent truncation (GH-11974) --#}\n {%- if column_value is string and 'varying' in column_type -%}\n {%- set column_type = column_type.split('(')[0] -%}\n {%- endif -%}\n\n {#-- sanitize column_value: wrap yaml strings in quotes, apply cast --#}\n {%- set column_value_clean = column_value -%}\n {%- if column_value is string -%}\n {%- set column_value_clean = dbt.string_literal(dbt.escape_single_quotes(column_value)) -%}\n {%- elif column_value is none -%}\n {%- set column_value_clean = 'null' -%}\n {%- endif -%}\n\n {%- set row_update = {column_name: safe_cast(column_value_clean, column_type) } -%}\n {%- do formatted_row.update(row_update) -%}\n {%- endfor -%}\n {{ return(formatted_row) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.string_literal", "macro.dbt.escape_single_quotes", "macro.dbt.safe_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6219363, "supported_languages": null}, "macro.dbt.validate_fixture_rows": {"name": "validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.validate_fixture_rows", "macro_sql": "{%- macro validate_fixture_rows(rows, row_number) -%}\n {{ return(adapter.dispatch('validate_fixture_rows', 'dbt')(rows, row_number)) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt.default__validate_fixture_rows"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6223714, "supported_languages": null}, "macro.dbt.default__validate_fixture_rows": {"name": "default__validate_fixture_rows", "resource_type": "macro", "package_name": "dbt", "path": "macros/unit_test_sql/get_fixture_sql.sql", "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", "unique_id": "macro.dbt.default__validate_fixture_rows", "macro_sql": "{%- macro default__validate_fixture_rows(rows, row_number) -%}\n {# This is an abstract method for adapter overrides as needed #}\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6225739, "supported_languages": null}, "macro.dbt.test_unique": {"name": "test_unique", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_unique", "macro_sql": "{% test unique(model, column_name) %}\n {% set macro = adapter.dispatch('test_unique', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_unique"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6234446, "supported_languages": null}, "macro.dbt.test_not_null": {"name": "test_not_null", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_not_null", "macro_sql": "{% test not_null(model, column_name) %}\n {% set macro = adapter.dispatch('test_not_null', 'dbt') %}\n {{ macro(model, column_name) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_not_null"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6239512, "supported_languages": null}, "macro.dbt.test_accepted_values": {"name": "test_accepted_values", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_accepted_values", "macro_sql": "{% test accepted_values(model, column_name, values, quote=True) %}\n {% set macro = adapter.dispatch('test_accepted_values', 'dbt') %}\n {{ macro(model, column_name, values, quote) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6245432, "supported_languages": null}, "macro.dbt.test_relationships": {"name": "test_relationships", "resource_type": "macro", "package_name": "dbt", "path": "tests/generic/builtin.sql", "original_file_path": "tests/generic/builtin.sql", "unique_id": "macro.dbt.test_relationships", "macro_sql": "{% test relationships(model, column_name, to, field) %}\n {% set macro = adapter.dispatch('test_relationships', 'dbt') %}\n {{ macro(model, column_name, to, field) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt.default__test_relationships"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6251485, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6264656, "supported_languages": null}, "macro.salesforce.coalesce_rename": {"name": "coalesce_rename", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/coalesce_rename.sql", "original_file_path": "macros/staging/coalesce_rename.sql", "unique_id": "macro.salesforce.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{#\n This macro is the final step in a workflow applied across models. It accommodates Fivetran connectors that retain Salesforce's original field naming conventions, which are camelCase instead of snake_case.\n\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\n\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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6279805, "supported_languages": null}, "macro.salesforce.column_list_to_dict": {"name": "column_list_to_dict", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/column_list_to_dict.sql", "original_file_path": "macros/staging/column_list_to_dict.sql", "unique_id": "macro.salesforce.column_list_to_dict", "macro_sql": "{% macro column_list_to_dict(column_list) %}\n\n{# \n This macro is a step in a workflow applied across models. It 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\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.628905, "supported_languages": null}, "macro.salesforce.get_lead_columns": {"name": "get_lead_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_lead_columns.sql", "original_file_path": "macros/staging/get_lead_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6373556, "supported_languages": null}, "macro.salesforce.get_user_columns": {"name": "get_user_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_user_columns.sql", "original_file_path": "macros/staging/get_user_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6433897, "supported_languages": null}, "macro.salesforce.add_renamed_columns": {"name": "add_renamed_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/add_renamed_columns.sql", "original_file_path": "macros/staging/add_renamed_columns.sql", "unique_id": "macro.salesforce.add_renamed_columns", "macro_sql": "{% macro add_renamed_columns(column_list) %}\n{# \n This macro is a step in a workflow applied across models. It appends camelCase spellings to the list of snake_case spellings generated by the `get_*_columns` macro. \n By default, it transforms column names by removing underscores and capitalizing each segment following an underscore. \n Additionally, it tags each column with its renamed version to facilitate tracking and consistency. \n\n Overview:\n 1. `get_*_columns`: Creates list of snake_case columns for a given source table. \n 1a. `add_renamed_columns`: Appends camelCase spellings of columns to the list. \n 1b. `add_pass_through_columns`: Appends columns specified in the passthrough variable to the list. \n 2. `column_list_to_dict`: Converts the list of columns generated in Step 1 into a dictionary, simplifying subsequent operations. \n 3. `fill_staging_columns`: Ensures all columns from Step 1 are present in the source table by filling `null` values for any missing columns. For columns with multiple spellings, a `null` column is created for the unused spelling. \n 4. `coalesce_rename`: Uses the dictionary from `column_list_to_dict` to coalesce a column with its renamed counterpart. This step generates the final column and supports custom arguments for renamed spelling, data type, and alias to override default values. \n#}\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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.64551, "supported_languages": null}, "macro.salesforce.get_opportunity_line_item_columns": {"name": "get_opportunity_line_item_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_opportunity_line_item_columns.sql", "original_file_path": "macros/staging/get_opportunity_line_item_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6505625, "supported_languages": null}, "macro.salesforce.get_record_type_columns": {"name": "get_record_type_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_record_type_columns.sql", "original_file_path": "macros/staging/get_record_type_columns.sql", "unique_id": "macro.salesforce.get_record_type_columns", "macro_sql": "{% macro get_record_type_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"description\", \"datatype\": dbt.type_string()},\n {\"name\": \"developer_name\", \"datatype\": dbt.type_string()},\n {\"name\": \"id\", \"datatype\": dbt.type_string()},\n {\"name\": \"is_active\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"namespace_prefix\", \"datatype\": dbt.type_string()},\n {\"name\": \"sobject_type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce.add_renamed_columns(columns) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce.add_renamed_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.652622, "supported_languages": null}, "macro.salesforce.get_product_2_columns": {"name": "get_product_2_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_product_2_columns.sql", "original_file_path": "macros/staging/get_product_2_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6578703, "supported_languages": null}, "macro.salesforce.get_task_columns": {"name": "get_task_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_task_columns.sql", "original_file_path": "macros/staging/get_task_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6635516, "supported_languages": null}, "macro.salesforce.get_order_columns": {"name": "get_order_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_order_columns.sql", "original_file_path": "macros/staging/get_order_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6706872, "supported_languages": null}, "macro.salesforce.get_account_columns": {"name": "get_account_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_account_columns.sql", "original_file_path": "macros/staging/get_account_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6774716, "supported_languages": null}, "macro.salesforce.get_event_columns": {"name": "get_event_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_event_columns.sql", "original_file_path": "macros/staging/get_event_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6830013, "supported_languages": null}, "macro.salesforce.get_opportunity_columns": {"name": "get_opportunity_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_opportunity_columns.sql", "original_file_path": "macros/staging/get_opportunity_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.689247, "supported_languages": null}, "macro.salesforce.get_campaign_member_columns": {"name": "get_campaign_member_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_campaign_member_columns.sql", "original_file_path": "macros/staging/get_campaign_member_columns.sql", "unique_id": "macro.salesforce.get_campaign_member_columns", "macro_sql": "{% macro get_campaign_member_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_active\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"account_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"campaign_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_by_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"created_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"first_responded_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"has_opted_out_of_email\", \"datatype\": \"boolean\"},\n {\"name\": \"has_responded\", \"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\": \"lead_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"lead_or_contact_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"lead_or_contact_owner_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__campaign_member_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_string", "macro.salesforce.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6928048, "supported_languages": null}, "macro.salesforce.get_campaign_columns": {"name": "get_campaign_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_campaign_columns.sql", "original_file_path": "macros/staging/get_campaign_columns.sql", "unique_id": "macro.salesforce.get_campaign_columns", "macro_sql": "{% macro get_campaign_columns() %}\n\n{% set columns = [\n {\"name\": \"_fivetran_active\", \"datatype\": \"boolean\"},\n {\"name\": \"_fivetran_synced\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"actual_cost\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"amount_all_opportunities\", \"datatype\": dbt.type_numeric()},\n {\"name\": \"budgeted_cost\", \"datatype\": dbt.type_numeric()},\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_active\", \"datatype\": \"boolean\"},\n {\"name\": \"is_deleted\", \"datatype\": \"boolean\"},\n {\"name\": \"name\", \"datatype\": dbt.type_string()},\n {\"name\": \"number_of_contacts\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_converted_leads\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_leads\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_opportunities\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_responses\", \"datatype\": dbt.type_int()},\n {\"name\": \"number_of_won_opportunities\", \"datatype\": dbt.type_int()},\n {\"name\": \"campaign_member_record_type_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"parent_id\", \"datatype\": dbt.type_string()},\n {\"name\": \"start_date\", \"datatype\": dbt.type_timestamp()},\n {\"name\": \"status\", \"datatype\": dbt.type_string()},\n {\"name\": \"type\", \"datatype\": dbt.type_string()}\n] %}\n\n{{ salesforce.add_renamed_columns(columns) }}\n\n{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__campaign_pass_through_columns')) }}\n\n{{ return(columns) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_timestamp", "macro.dbt.type_numeric", "macro.dbt.type_string", "macro.dbt.type_int", "macro.salesforce.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.6971703, "supported_languages": null}, "macro.salesforce.get_contact_columns": {"name": "get_contact_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_contact_columns.sql", "original_file_path": "macros/staging/get_contact_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.703439, "supported_languages": null}, "macro.salesforce.get_user_role_columns": {"name": "get_user_role_columns", "resource_type": "macro", "package_name": "salesforce", "path": "macros/staging/get_user_role_columns.sql", "original_file_path": "macros/staging/get_user_role_columns.sql", "unique_id": "macro.salesforce.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.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.add_renamed_columns", "macro.fivetran_utils.add_pass_through_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7057078, "supported_languages": null}, "macro.dbt_utils.safe_add": {"name": "safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.safe_add", "macro_sql": "{%- macro safe_add(field_list) -%}\n {{ return(adapter.dispatch('safe_add', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7064123, "supported_languages": null}, "macro.dbt_utils.default__safe_add": {"name": "default__safe_add", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_add.sql", "original_file_path": "macros/sql/safe_add.sql", "unique_id": "macro.dbt_utils.default__safe_add", "macro_sql": "\n\n{%- macro default__safe_add(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_add` macro now takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.warn(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' +\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.707528, "supported_languages": null}, "macro.dbt_utils.get_filtered_columns_in_relation": {"name": "get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.get_filtered_columns_in_relation", "macro_sql": "{% macro get_filtered_columns_in_relation(from, except=[]) -%}\n {{ return(adapter.dispatch('get_filtered_columns_in_relation', 'dbt_utils')(from, except)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7083354, "supported_languages": null}, "macro.dbt_utils.default__get_filtered_columns_in_relation": {"name": "default__get_filtered_columns_in_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_filtered_columns_in_relation.sql", "original_file_path": "macros/sql/get_filtered_columns_in_relation.sql", "unique_id": "macro.dbt_utils.default__get_filtered_columns_in_relation", "macro_sql": "{% macro default__get_filtered_columns_in_relation(from, except=[]) -%}\n {%- do dbt_utils._is_relation(from, 'get_filtered_columns_in_relation') -%}\n {%- do dbt_utils._is_ephemeral(from, 'get_filtered_columns_in_relation') -%}\n\n {# -- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {{ return([]) }}\n {% endif %}\n\n {%- set include_cols = [] %}\n {%- set cols = adapter.get_columns_in_relation(from) -%}\n {%- set except = except | map(\"lower\") | list %}\n {%- for col in cols -%}\n {%- if col.column|lower not in except -%}\n {% do include_cols.append(col.column) %}\n {%- endif %}\n {%- endfor %}\n\n {{ return(include_cols) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.709786, "supported_languages": null}, "macro.dbt_utils.nullcheck_table": {"name": "nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.nullcheck_table", "macro_sql": "{% macro nullcheck_table(relation) %}\n {{ return(adapter.dispatch('nullcheck_table', 'dbt_utils')(relation)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck_table"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.710378, "supported_languages": null}, "macro.dbt_utils.default__nullcheck_table": {"name": "default__nullcheck_table", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck_table.sql", "original_file_path": "macros/sql/nullcheck_table.sql", "unique_id": "macro.dbt_utils.default__nullcheck_table", "macro_sql": "{% macro default__nullcheck_table(relation) %}\n\n {%- do dbt_utils._is_relation(relation, 'nullcheck_table') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'nullcheck_table') -%}\n {% set cols = adapter.get_columns_in_relation(relation) %}\n\n select {{ dbt_utils.nullcheck(cols) }}\n from {{relation}}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7110763, "supported_languages": null}, "macro.dbt_utils.deduplicate": {"name": "deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.deduplicate", "macro_sql": "{%- macro deduplicate(relation, partition_by, order_by) -%}\n {{ return(adapter.dispatch('deduplicate', 'dbt_utils')(relation, partition_by, order_by)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.postgres__deduplicate"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7121527, "supported_languages": null}, "macro.dbt_utils.default__deduplicate": {"name": "default__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.default__deduplicate", "macro_sql": "\n\n{%- macro default__deduplicate(relation, partition_by, order_by) -%}\n\n with row_numbered as (\n select\n _inner.*,\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) as rn\n from {{ relation }} as _inner\n )\n\n select\n distinct data.*\n from {{ relation }} as data\n {#\n -- Not all DBs will support natural joins but the ones that do include:\n -- Oracle, MySQL, SQLite, Redshift, Teradata, Materialize, Databricks\n -- Apache Spark, SingleStore, Vertica\n -- Those that do not appear to support natural joins include:\n -- SQLServer, Trino, Presto, Rockset, Athena\n #}\n natural join row_numbered\n where row_numbered.rn = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7125921, "supported_languages": null}, "macro.dbt_utils.redshift__deduplicate": {"name": "redshift__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.redshift__deduplicate", "macro_sql": "{% macro redshift__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }} as tt\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7129617, "supported_languages": null}, "macro.dbt_utils.postgres__deduplicate": {"name": "postgres__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.postgres__deduplicate", "macro_sql": "\n{%- macro postgres__deduplicate(relation, partition_by, order_by) -%}\n\n select\n distinct on ({{ partition_by }}) *\n from {{ relation }}\n order by {{ partition_by }}{{ ',' ~ order_by }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7133582, "supported_languages": null}, "macro.dbt_utils.snowflake__deduplicate": {"name": "snowflake__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.snowflake__deduplicate", "macro_sql": "\n{%- macro snowflake__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7137022, "supported_languages": null}, "macro.dbt_utils.databricks__deduplicate": {"name": "databricks__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.databricks__deduplicate", "macro_sql": "\n{%- macro databricks__deduplicate(relation, partition_by, order_by) -%}\n\n select *\n from {{ relation }}\n qualify\n row_number() over (\n partition by {{ partition_by }}\n order by {{ order_by }}\n ) = 1\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7140682, "supported_languages": null}, "macro.dbt_utils.bigquery__deduplicate": {"name": "bigquery__deduplicate", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/deduplicate.sql", "original_file_path": "macros/sql/deduplicate.sql", "unique_id": "macro.dbt_utils.bigquery__deduplicate", "macro_sql": "\n{%- macro bigquery__deduplicate(relation, partition_by, order_by) -%}\n\n select unique.*\n from (\n select\n array_agg (\n original\n order by {{ order_by }}\n limit 1\n )[offset(0)] unique\n from {{ relation }} original\n group by {{ partition_by }}\n )\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7144141, "supported_languages": null}, "macro.dbt_utils.get_tables_by_prefix_sql": {"name": "get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_prefix_sql", "macro_sql": "{% macro get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_prefix_sql', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7151608, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_prefix_sql": {"name": "default__get_tables_by_prefix_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_prefix_sql.sql", "original_file_path": "macros/sql/get_tables_by_prefix_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_prefix_sql", "macro_sql": "{% macro default__get_tables_by_prefix_sql(schema, prefix, exclude='', database=target.database) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(\n schema_pattern = schema,\n table_pattern = prefix ~ '%',\n exclude = exclude,\n database = database\n ) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7158725, "supported_languages": null}, "macro.dbt_utils.get_powers_of_two": {"name": "get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.get_powers_of_two", "macro_sql": "{% macro get_powers_of_two(upper_bound) %}\n {{ return(adapter.dispatch('get_powers_of_two', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7167134, "supported_languages": null}, "macro.dbt_utils.default__get_powers_of_two": {"name": "default__get_powers_of_two", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__get_powers_of_two", "macro_sql": "{% macro default__get_powers_of_two(upper_bound) %}\n\n {% if upper_bound <= 0 %}\n {{ exceptions.raise_compiler_error(\"upper bound must be positive\") }}\n {% endif %}\n\n {% for _ in range(1, 100) %}\n {% if upper_bound <= 2 ** loop.index %}{{ return(loop.index) }}{% endif %}\n {% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.717561, "supported_languages": null}, "macro.dbt_utils.generate_series": {"name": "generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.generate_series", "macro_sql": "{% macro generate_series(upper_bound) %}\n {{ return(adapter.dispatch('generate_series', 'dbt_utils')(upper_bound)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_series"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.717963, "supported_languages": null}, "macro.dbt_utils.default__generate_series": {"name": "default__generate_series", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_series.sql", "original_file_path": "macros/sql/generate_series.sql", "unique_id": "macro.dbt_utils.default__generate_series", "macro_sql": "{% macro default__generate_series(upper_bound) %}\n\n {% set n = dbt_utils.get_powers_of_two(upper_bound) %}\n\n with p as (\n select 0 as generated_number union all select 1\n ), unioned as (\n\n select\n\n {% for i in range(n) %}\n p{{i}}.generated_number * power(2, {{i}})\n {% if not loop.last %} + {% endif %}\n {% endfor %}\n + 1\n as generated_number\n\n from\n\n {% for i in range(n) %}\n p as p{{i}}\n {% if not loop.last %} cross join {% endif %}\n {% endfor %}\n\n )\n\n select *\n from unioned\n where generated_number <= {{upper_bound}}\n order by generated_number\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_powers_of_two"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7190077, "supported_languages": null}, "macro.dbt_utils.safe_divide": {"name": "safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.safe_divide", "macro_sql": "{% macro safe_divide(numerator, denominator) -%}\n {{ return(adapter.dispatch('safe_divide', 'dbt_utils')(numerator, denominator)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_divide"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7195675, "supported_languages": null}, "macro.dbt_utils.default__safe_divide": {"name": "default__safe_divide", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_divide.sql", "original_file_path": "macros/sql/safe_divide.sql", "unique_id": "macro.dbt_utils.default__safe_divide", "macro_sql": "{% macro default__safe_divide(numerator, denominator) %}\n ( {{ numerator }} ) / nullif( ( {{ denominator }} ), 0)\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7198699, "supported_languages": null}, "macro.dbt_utils.get_query_results_as_dict": {"name": "get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.get_query_results_as_dict", "macro_sql": "{% macro get_query_results_as_dict(query) %}\n {{ return(adapter.dispatch('get_query_results_as_dict', 'dbt_utils')(query)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_query_results_as_dict"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7205162, "supported_languages": null}, "macro.dbt_utils.default__get_query_results_as_dict": {"name": "default__get_query_results_as_dict", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_query_results_as_dict.sql", "original_file_path": "macros/sql/get_query_results_as_dict.sql", "unique_id": "macro.dbt_utils.default__get_query_results_as_dict", "macro_sql": "{% macro default__get_query_results_as_dict(query) %}\n\n{# This macro returns a dictionary of the form {column_name: (tuple_of_results)} #}\n\n {%- call statement('get_query_results', fetch_result=True,auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {% set sql_results={} %}\n\n {%- if execute -%}\n {% set sql_results_table = load_result('get_query_results').table.columns %}\n {% for column_name, column in sql_results_table.items() %}\n {% do sql_results.update({column_name: column.values()}) %}\n {% endfor %}\n {%- endif -%}\n\n {{ return(sql_results) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7216835, "supported_languages": null}, "macro.dbt_utils.get_relations_by_pattern": {"name": "get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.get_relations_by_pattern", "macro_sql": "{% macro get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_pattern', 'dbt_utils')(schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_pattern"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7226038, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_pattern": {"name": "default__get_relations_by_pattern", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_pattern.sql", "original_file_path": "macros/sql/get_relations_by_pattern.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_pattern", "macro_sql": "{% macro default__get_relations_by_pattern(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7243166, "supported_languages": null}, "macro.dbt_utils.nullcheck": {"name": "nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.nullcheck", "macro_sql": "{% macro nullcheck(cols) %}\n {{ return(adapter.dispatch('nullcheck', 'dbt_utils')(cols)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__nullcheck"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7249503, "supported_languages": null}, "macro.dbt_utils.default__nullcheck": {"name": "default__nullcheck", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/nullcheck.sql", "original_file_path": "macros/sql/nullcheck.sql", "unique_id": "macro.dbt_utils.default__nullcheck", "macro_sql": "{% macro default__nullcheck(cols) %}\n{%- for col in cols %}\n\n {% if col.is_string() -%}\n\n nullif({{col.name}},'') as {{col.name}}\n\n {%- else -%}\n\n {{col.name}}\n\n {%- endif -%}\n\n{%- if not loop.last -%} , {%- endif -%}\n\n{%- endfor -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.725611, "supported_languages": null}, "macro.dbt_utils.get_single_value": {"name": "get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.get_single_value", "macro_sql": "{% macro get_single_value(query, default=none) %}\n {{ return(adapter.dispatch('get_single_value', 'dbt_utils')(query, default)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_single_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7264194, "supported_languages": null}, "macro.dbt_utils.default__get_single_value": {"name": "default__get_single_value", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_single_value.sql", "original_file_path": "macros/sql/get_single_value.sql", "unique_id": "macro.dbt_utils.default__get_single_value", "macro_sql": "{% macro default__get_single_value(query, default) %}\n\n{# This macro returns the (0, 0) record in a query, i.e. the first row of the first column #}\n\n {%- call statement('get_query_result', fetch_result=True, auto_begin=false) -%}\n\n {{ query }}\n\n {%- endcall -%}\n\n {%- if execute -%}\n\n {% set r = load_result('get_query_result').table.columns[0].values() %}\n {% if r | length == 0 %}\n {% do print('Query `' ~ query ~ '` returned no rows. Using the default value: ' ~ default) %}\n {% set sql_result = default %}\n {% else %}\n {% set sql_result = r[0] %}\n {% endif %}\n \n {%- else -%}\n \n {% set sql_result = default %}\n \n {%- endif -%}\n\n {% do return(sql_result) %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7282708, "supported_languages": null}, "macro.dbt_utils.generate_surrogate_key": {"name": "generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.generate_surrogate_key", "macro_sql": "{%- macro generate_surrogate_key(field_list) -%}\n {{ return(adapter.dispatch('generate_surrogate_key', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__generate_surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7293622, "supported_languages": null}, "macro.dbt_utils.default__generate_surrogate_key": {"name": "default__generate_surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/generate_surrogate_key.sql", "original_file_path": "macros/sql/generate_surrogate_key.sql", "unique_id": "macro.dbt_utils.default__generate_surrogate_key", "macro_sql": "\n\n{%- macro default__generate_surrogate_key(field_list) -%}\n\n{%- if var('surrogate_key_treat_nulls_as_empty_strings', False) -%}\n {%- set default_null_value = \"\" -%}\n{%- else -%}\n {%- set default_null_value = '_dbt_utils_surrogate_key_null_' -%}\n{%- endif -%}\n\n{%- set fields = [] -%}\n\n{%- for field in field_list -%}\n\n {%- do fields.append(\n \"coalesce(cast(\" ~ field ~ \" as \" ~ dbt.type_string() ~ \"), '\" ~ default_null_value ~\"')\"\n ) -%}\n\n {%- if not loop.last %}\n {%- do fields.append(\"'-'\") -%}\n {%- endif -%}\n\n{%- endfor -%}\n\n{{ dbt.hash(dbt.concat(fields)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt.type_string", "macro.dbt.hash", "macro.dbt.concat"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.730924, "supported_languages": null}, "macro.dbt_utils.get_intervals_between": {"name": "get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.get_intervals_between", "macro_sql": "{% macro get_intervals_between(start_date, end_date, datepart) -%}\n {{ return(adapter.dispatch('get_intervals_between', 'dbt_utils')(start_date, end_date, datepart)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_intervals_between"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7322123, "supported_languages": null}, "macro.dbt_utils.default__get_intervals_between": {"name": "default__get_intervals_between", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__get_intervals_between", "macro_sql": "{% macro default__get_intervals_between(start_date, end_date, datepart) -%}\n {%- call statement('get_intervals_between', fetch_result=True) %}\n\n select {{ dbt.datediff(start_date, end_date, datepart) }}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_intervals_between') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values[0]) }}\n {%- else -%}\n {{ return(1) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.733609, "supported_languages": null}, "macro.dbt_utils.date_spine": {"name": "date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.date_spine", "macro_sql": "{% macro date_spine(datepart, start_date, end_date) %}\n {{ return(adapter.dispatch('date_spine', 'dbt_utils')(datepart, start_date, end_date)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7342045, "supported_languages": null}, "macro.dbt_utils.default__date_spine": {"name": "default__date_spine", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/date_spine.sql", "original_file_path": "macros/sql/date_spine.sql", "unique_id": "macro.dbt_utils.default__date_spine", "macro_sql": "{% macro default__date_spine(datepart, start_date, end_date) %}\n\n\n{# call as follows:\n\ndate_spine(\n \"day\",\n \"to_date('01/01/2016', 'mm/dd/yyyy')\",\n \"dbt.dateadd(week, 1, current_date)\"\n) #}\n\n\nwith rawdata as (\n\n {{dbt_utils.generate_series(\n dbt_utils.get_intervals_between(start_date, end_date, datepart)\n )}}\n\n),\n\nall_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n \"row_number() over (order by generated_number) - 1\",\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n\n),\n\nfiltered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n)\n\nselect * from filtered\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.generate_series", "macro.dbt_utils.get_intervals_between", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7350912, "supported_languages": null}, "macro.dbt_utils.get_relations_by_prefix": {"name": "get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.get_relations_by_prefix", "macro_sql": "{% macro get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_relations_by_prefix', 'dbt_utils')(schema, prefix, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_relations_by_prefix"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7363338, "supported_languages": null}, "macro.dbt_utils.default__get_relations_by_prefix": {"name": "default__get_relations_by_prefix", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_relations_by_prefix.sql", "original_file_path": "macros/sql/get_relations_by_prefix.sql", "unique_id": "macro.dbt_utils.default__get_relations_by_prefix", "macro_sql": "{% macro default__get_relations_by_prefix(schema, prefix, exclude='', database=target.database) %}\n\n {%- call statement('get_tables', fetch_result=True) %}\n\n {{ dbt_utils.get_tables_by_prefix_sql(schema, prefix, exclude, database) }}\n\n {%- endcall -%}\n\n {%- set table_list = load_result('get_tables') -%}\n\n {%- if table_list and table_list['table'] -%}\n {%- set tbl_relations = [] -%}\n {%- for row in table_list['table'] -%}\n {%- set tbl_relation = api.Relation.create(\n database=database,\n schema=row.table_schema,\n identifier=row.table_name,\n type=row.table_type\n ) -%}\n {%- do tbl_relations.append(tbl_relation) -%}\n {%- endfor -%}\n\n {{ return(tbl_relations) }}\n {%- else -%}\n {{ return([]) }}\n {%- endif -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt_utils.get_tables_by_prefix_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.73856, "supported_languages": null}, "macro.dbt_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations', 'dbt_utils')(relations, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7413168, "supported_languages": null}, "macro.dbt_utils.default__union_relations": {"name": "default__union_relations", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/union.sql", "original_file_path": "macros/sql/union.sql", "unique_id": "macro.dbt_utils.default__union_relations", "macro_sql": "\n\n{%- macro default__union_relations(relations, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n cast({{ dbt.string_literal(relation.render()) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n /* No columns from any of the relations.\n This star is only output during dbt compile, and exists to keep SQLFluff happy. */\n {% if dbt_command == 'compile' and ordered_column_names|length == 0 %}\n *\n {% endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ relation }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.749663, "supported_languages": null}, "macro.dbt_utils.get_tables_by_pattern_sql": {"name": "get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.get_tables_by_pattern_sql", "macro_sql": "{% macro get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n {{ return(adapter.dispatch('get_tables_by_pattern_sql', 'dbt_utils')\n (schema_pattern, table_pattern, exclude, database)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_tables_by_pattern_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7512965, "supported_languages": null}, "macro.dbt_utils.default__get_tables_by_pattern_sql": {"name": "default__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.default__get_tables_by_pattern_sql", "macro_sql": "{% macro default__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from {{ database }}.information_schema.tables\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7520716, "supported_languages": null}, "macro.dbt_utils.redshift__get_tables_by_pattern_sql": {"name": "redshift__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.redshift__get_tables_by_pattern_sql", "macro_sql": "{% macro redshift__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% set sql %}\n select distinct\n table_schema as {{ adapter.quote('table_schema') }},\n table_name as {{ adapter.quote('table_name') }},\n {{ dbt_utils.get_table_types_sql() }}\n from \"{{ database }}\".\"information_schema\".\"tables\"\n where table_schema ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n union all\n select distinct\n schemaname as {{ adapter.quote('table_schema') }},\n tablename as {{ adapter.quote('table_name') }},\n 'external' as {{ adapter.quote('table_type') }}\n from svv_external_tables\n where redshift_database_name = '{{ database }}'\n and schemaname ilike '{{ schema_pattern }}'\n and table_name ilike '{{ table_pattern }}'\n and table_name not ilike '{{ exclude }}'\n {% endset %}\n\n {{ return(sql) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7534604, "supported_languages": null}, "macro.dbt_utils.bigquery__get_tables_by_pattern_sql": {"name": "bigquery__get_tables_by_pattern_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils.bigquery__get_tables_by_pattern_sql", "macro_sql": "{% macro bigquery__get_tables_by_pattern_sql(schema_pattern, table_pattern, exclude='', database=target.database) %}\n\n {% if '%' in schema_pattern %}\n {% set schemata=dbt_utils._bigquery__get_matching_schemata(schema_pattern, database) %}\n {% else %}\n {% set schemata=[schema_pattern] %}\n {% endif %}\n\n {% set sql %}\n {% for schema in schemata %}\n select distinct\n table_schema,\n table_name,\n {{ dbt_utils.get_table_types_sql() }}\n\n from {{ adapter.quote(database) }}.{{ schema }}.INFORMATION_SCHEMA.TABLES\n where lower(table_name) like lower ('{{ table_pattern }}')\n and lower(table_name) not like lower ('{{ exclude }}')\n\n {% if not loop.last %} union all {% endif %}\n\n {% endfor %}\n {% endset %}\n\n {{ return(sql) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._bigquery__get_matching_schemata", "macro.dbt_utils.get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7549372, "supported_languages": null}, "macro.dbt_utils._bigquery__get_matching_schemata": {"name": "_bigquery__get_matching_schemata", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_tables_by_pattern_sql.sql", "original_file_path": "macros/sql/get_tables_by_pattern_sql.sql", "unique_id": "macro.dbt_utils._bigquery__get_matching_schemata", "macro_sql": "{% macro _bigquery__get_matching_schemata(schema_pattern, database) %}\n {% if execute %}\n\n {% set sql %}\n select schema_name from {{ adapter.quote(database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like lower('{{ schema_pattern }}')\n {% endset %}\n\n {% set results=run_query(sql) %}\n\n {% set schemata=results.columns['schema_name'].values() %}\n\n {{ return(schemata) }}\n\n {% else %}\n\n {{ return([]) }}\n\n {% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7559657, "supported_languages": null}, "macro.dbt_utils.group_by": {"name": "group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.group_by", "macro_sql": "{%- macro group_by(n) -%}\n {{ return(adapter.dispatch('group_by', 'dbt_utils')(n)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__group_by"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7565277, "supported_languages": null}, "macro.dbt_utils.default__group_by": {"name": "default__group_by", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/groupby.sql", "original_file_path": "macros/sql/groupby.sql", "unique_id": "macro.dbt_utils.default__group_by", "macro_sql": "\n\n{%- macro default__group_by(n) -%}\n\n group by {% for i in range(1, n + 1) -%}\n {{ i }}{{ ',' if not loop.last }} \n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7570784, "supported_languages": null}, "macro.dbt_utils.get_table_types_sql": {"name": "get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.get_table_types_sql", "macro_sql": "{%- macro get_table_types_sql() -%}\n {{ return(adapter.dispatch('get_table_types_sql', 'dbt_utils')()) }}\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils.postgres__get_table_types_sql"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7576835, "supported_languages": null}, "macro.dbt_utils.default__get_table_types_sql": {"name": "default__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.default__get_table_types_sql", "macro_sql": "{% macro default__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'EXTERNAL TABLE' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7580056, "supported_languages": null}, "macro.dbt_utils.postgres__get_table_types_sql": {"name": "postgres__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.postgres__get_table_types_sql", "macro_sql": "{% macro postgres__get_table_types_sql() %}\n case table_type\n when 'BASE TABLE' then 'table'\n when 'FOREIGN' then 'external'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7582862, "supported_languages": null}, "macro.dbt_utils.databricks__get_table_types_sql": {"name": "databricks__get_table_types_sql", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_table_types_sql.sql", "original_file_path": "macros/sql/get_table_types_sql.sql", "unique_id": "macro.dbt_utils.databricks__get_table_types_sql", "macro_sql": "{% macro databricks__get_table_types_sql() %}\n case table_type\n when 'MANAGED' then 'table'\n when 'BASE TABLE' then 'table'\n when 'MATERIALIZED VIEW' then 'materializedview'\n else lower(table_type)\n end as {{ adapter.quote('table_type') }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7585657, "supported_languages": null}, "macro.dbt_utils.degrees_to_radians": {"name": "degrees_to_radians", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.degrees_to_radians", "macro_sql": "{% macro degrees_to_radians(degrees) -%}\n acos(-1) * {{degrees}} / 180\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.759463, "supported_languages": null}, "macro.dbt_utils.haversine_distance": {"name": "haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.haversine_distance", "macro_sql": "{% macro haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n {{ return(adapter.dispatch('haversine_distance', 'dbt_utils')(lat1,lon1,lat2,lon2,unit)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__haversine_distance"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7600553, "supported_languages": null}, "macro.dbt_utils.default__haversine_distance": {"name": "default__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.default__haversine_distance", "macro_sql": "{% macro default__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n\n 2 * 3961 * asin(sqrt(power((sin(radians(({{ lat2 }} - {{ lat1 }}) / 2))), 2) +\n cos(radians({{lat1}})) * cos(radians({{lat2}})) *\n power((sin(radians(({{ lon2 }} - {{ lon1 }}) / 2))), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7613308, "supported_languages": null}, "macro.dbt_utils.bigquery__haversine_distance": {"name": "bigquery__haversine_distance", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/haversine_distance.sql", "original_file_path": "macros/sql/haversine_distance.sql", "unique_id": "macro.dbt_utils.bigquery__haversine_distance", "macro_sql": "{% macro bigquery__haversine_distance(lat1, lon1, lat2, lon2, unit='mi') -%}\n{% set radians_lat1 = dbt_utils.degrees_to_radians(lat1) %}\n{% set radians_lat2 = dbt_utils.degrees_to_radians(lat2) %}\n{% set radians_lon1 = dbt_utils.degrees_to_radians(lon1) %}\n{% set radians_lon2 = dbt_utils.degrees_to_radians(lon2) %}\n{%- if unit == 'mi' %}\n {% set conversion_rate = 1 %}\n{% elif unit == 'km' %}\n {% set conversion_rate = 1.60934 %}\n{% else %}\n {{ exceptions.raise_compiler_error(\"unit input must be one of 'mi' or 'km'. Got \" ~ unit) }}\n{% endif %}\n 2 * 3961 * asin(sqrt(power(sin(({{ radians_lat2 }} - {{ radians_lat1 }}) / 2), 2) +\n cos({{ radians_lat1 }}) * cos({{ radians_lat2 }}) *\n power(sin(({{ radians_lon2 }} - {{ radians_lon1 }}) / 2), 2))) * {{ conversion_rate }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.degrees_to_radians"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.763007, "supported_languages": null}, "macro.dbt_utils.safe_subtract": {"name": "safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.safe_subtract", "macro_sql": "{%- macro safe_subtract(field_list) -%}\n {{ return(adapter.dispatch('safe_subtract', 'dbt_utils')(field_list)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__safe_subtract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7636752, "supported_languages": null}, "macro.dbt_utils.default__safe_subtract": {"name": "default__safe_subtract", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/safe_subtract.sql", "original_file_path": "macros/sql/safe_subtract.sql", "unique_id": "macro.dbt_utils.default__safe_subtract", "macro_sql": "\n\n{%- macro default__safe_subtract(field_list) -%}\n\n{%- if field_list is not iterable or field_list is string or field_list is mapping -%}\n\n{%- set error_message = '\nWarning: the `safe_subtract` macro takes a single list argument instead of \\\nstring arguments. The {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endif -%}\n\n{% set fields = [] %}\n\n{%- for field in field_list -%}\n\n {% do fields.append(\"coalesce(\" ~ field ~ \", 0)\") %}\n\n{%- endfor -%}\n\n{{ fields|join(' -\\n ') }}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7647746, "supported_languages": null}, "macro.dbt_utils.get_column_values": {"name": "get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.get_column_values", "macro_sql": "{% macro get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {{ return(adapter.dispatch('get_column_values', 'dbt_utils')(table, column, order_by, max_records, default, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_column_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.766235, "supported_languages": null}, "macro.dbt_utils.default__get_column_values": {"name": "default__get_column_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/get_column_values.sql", "original_file_path": "macros/sql/get_column_values.sql", "unique_id": "macro.dbt_utils.default__get_column_values", "macro_sql": "{% macro default__get_column_values(table, column, order_by='count(*) desc', max_records=none, default=none, where=none) -%}\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n {%- if not execute -%}\n {% set default = [] if not default %}\n {{ return(default) }}\n {% endif %}\n\n {%- do dbt_utils._is_ephemeral(table, 'get_column_values') -%}\n\n {# Not all relations are tables. Renaming for internal clarity without breaking functionality for anyone using named arguments #}\n {# TODO: Change the method signature in a future 0.x.0 release #}\n {%- set target_relation = table -%}\n\n {# adapter.load_relation is a convenience wrapper to avoid building a Relation when we already have one #}\n {% set relation_exists = (load_relation(target_relation)) is not none %}\n\n {%- call statement('get_column_values', fetch_result=true) %}\n\n {%- if not relation_exists and default is none -%}\n\n {{ exceptions.raise_compiler_error(\"In get_column_values(): relation \" ~ target_relation ~ \" does not exist and no default value was provided.\") }}\n\n {%- elif not relation_exists and default is not none -%}\n\n {{ log(\"Relation \" ~ target_relation ~ \" does not exist. Returning the default value: \" ~ default) }}\n\n {{ return(default) }}\n\n {%- else -%}\n\n\n select\n {{ column }} as value\n\n from {{ target_relation }}\n\n {% if where is not none %}\n where {{ where }}\n {% endif %}\n\n group by {{ column }}\n order by {{ order_by }}\n\n {% if max_records is not none %}\n limit {{ max_records }}\n {% endif %}\n\n {% endif %}\n\n {%- endcall -%}\n\n {%- set value_list = load_result('get_column_values') -%}\n\n {%- if value_list and value_list['data'] -%}\n {%- set values = value_list['data'] | map(attribute=0) | list %}\n {{ return(values) }}\n {%- else -%}\n {{ return(default) }}\n {%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_ephemeral", "macro.dbt.load_relation", "macro.dbt.statement"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7692592, "supported_languages": null}, "macro.dbt_utils.width_bucket": {"name": "width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.width_bucket", "macro_sql": "{% macro width_bucket(expr, min_value, max_value, num_buckets) %}\n {{ return(adapter.dispatch('width_bucket', 'dbt_utils') (expr, min_value, max_value, num_buckets)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__width_bucket"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.770154, "supported_languages": null}, "macro.dbt_utils.default__width_bucket": {"name": "default__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.default__width_bucket", "macro_sql": "{% macro default__width_bucket(expr, min_value, max_value, num_buckets) -%}\n\n {% set bin_size -%}\n (( {{ max_value }} - {{ min_value }} ) / {{ num_buckets }} )\n {%- endset %}\n (\n -- to break ties when the amount is eaxtly at the bucket egde\n case\n when\n mod(\n {{ dbt.safe_cast(expr, dbt.type_numeric() ) }},\n {{ dbt.safe_cast(bin_size, dbt.type_numeric() ) }}\n ) = 0\n then 1\n else 0\n end\n ) +\n -- Anything over max_value goes the N+1 bucket\n least(\n ceil(\n ({{ expr }} - {{ min_value }})/{{ bin_size }}\n ),\n {{ num_buckets }} + 1\n )\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.safe_cast", "macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.771079, "supported_languages": null}, "macro.dbt_utils.snowflake__width_bucket": {"name": "snowflake__width_bucket", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/width_bucket.sql", "original_file_path": "macros/sql/width_bucket.sql", "unique_id": "macro.dbt_utils.snowflake__width_bucket", "macro_sql": "{% macro snowflake__width_bucket(expr, min_value, max_value, num_buckets) %}\n width_bucket({{ expr }}, {{ min_value }}, {{ max_value }}, {{ num_buckets }} )\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7714703, "supported_languages": null}, "macro.dbt_utils.star": {"name": "star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.star", "macro_sql": "{% macro star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {{ return(adapter.dispatch('star', 'dbt_utils')(from, relation_alias, except, prefix, suffix, quote_identifiers, unquote_aliases, rename)) }}\r\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7731228, "supported_languages": null}, "macro.dbt_utils.default__star": {"name": "default__star", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/star.sql", "original_file_path": "macros/sql/star.sql", "unique_id": "macro.dbt_utils.default__star", "macro_sql": "{% macro default__star(from, relation_alias=False, except=[], prefix='', suffix='', quote_identifiers=True, unquote_aliases=False, rename={}) -%}\r\n {%- do dbt_utils._is_relation(from, 'star') -%}\r\n {%- do dbt_utils._is_ephemeral(from, 'star') -%}\r\n\r\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\r\n {%- if not execute -%}\r\n {% do return('*') %}\r\n {%- endif -%}\r\n\r\n {% set cols = dbt_utils.get_filtered_columns_in_relation(from, except) %}\r\n\r\n {%- set rename_lower = {} -%}\r\n {%- for key, val in rename.items() -%}\r\n {%- do rename_lower.update({key.lower(): val}) -%}\r\n {%- endfor -%}\r\n\r\n {%- if cols|length <= 0 -%}\r\n {% if flags.WHICH == 'compile' %}\r\n {% set response %}\r\n*\r\n/* No columns were returned. Maybe the relation doesn't exist yet\r\nor all columns were excluded. This star is only output during\r\ndbt compile, and exists to keep SQLFluff happy. */\r\n {% endset %}\r\n {% do return(response) %}\r\n {% else %}\r\n {% do return(\"/* no columns returned from star() macro */\") %}\r\n {% endif %}\r\n {%- else -%}\r\n {%- for col in cols %}\r\n {%- if relation_alias %}{{ relation_alias }}.{% else %}{%- endif -%}\r\n {%- if quote_identifiers -%}\r\n {{ adapter.quote(col)|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif unquote_aliases %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ adapter.quote(prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- else -%}\r\n {{ col|trim }}\r\n {%- if col.lower() in rename_lower %} as {{ rename_lower[col.lower()] }}\r\n {%- elif prefix!='' or suffix!='' %} as {{ (prefix ~ col ~ suffix)|trim }}\r\n {%- endif -%}\r\n {%- endif -%}\r\n {%- if not loop.last %},{{ '\\n ' }}{%- endif -%}\r\n {%- endfor -%}\r\n {% endif %}\r\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt_utils.get_filtered_columns_in_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7771437, "supported_languages": null}, "macro.dbt_utils.pivot": {"name": "pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.pivot", "macro_sql": "{% macro pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {{ return(adapter.dispatch('pivot', 'dbt_utils')(column, values, alias, agg, cmp, prefix, suffix, then_value, else_value, quote_identifiers, distinct)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.778693, "supported_languages": null}, "macro.dbt_utils.default__pivot": {"name": "default__pivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/pivot.sql", "original_file_path": "macros/sql/pivot.sql", "unique_id": "macro.dbt_utils.default__pivot", "macro_sql": "{% macro default__pivot(column,\n values,\n alias=True,\n agg='sum',\n cmp='=',\n prefix='',\n suffix='',\n then_value=1,\n else_value=0,\n quote_identifiers=True,\n distinct=False) %}\n {% for value in values %}\n {{ agg }}(\n {% if distinct %} distinct {% endif %}\n case\n when {{ column }} {{ cmp }} '{{ dbt.escape_single_quotes(value) }}'\n then {{ then_value }}\n else {{ else_value }}\n end\n )\n {% if alias %}\n {% if quote_identifiers %}\n as {{ adapter.quote(prefix ~ value ~ suffix) }}\n {% else %}\n as {{ dbt_utils.slugify(prefix ~ value ~ suffix) }}\n {% endif %}\n {% endif %}\n {% if not loop.last %},{% endif %}\n {% endfor %}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.escape_single_quotes", "macro.dbt_utils.slugify"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7803767, "supported_languages": null}, "macro.dbt_utils.surrogate_key": {"name": "surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.surrogate_key", "macro_sql": "{%- macro surrogate_key(field_list) -%}\n {% set frustrating_jinja_feature = varargs %}\n {{ return(adapter.dispatch('surrogate_key', 'dbt_utils')(field_list, *varargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__surrogate_key"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.781064, "supported_languages": null}, "macro.dbt_utils.default__surrogate_key": {"name": "default__surrogate_key", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/surrogate_key.sql", "original_file_path": "macros/sql/surrogate_key.sql", "unique_id": "macro.dbt_utils.default__surrogate_key", "macro_sql": "\n\n{%- macro default__surrogate_key(field_list) -%}\n\n{%- set error_message = '\nWarning: `dbt_utils.surrogate_key` has been replaced by \\\n`dbt_utils.generate_surrogate_key`. The new macro treats null values \\\ndifferently to empty strings. To restore the behaviour of the original \\\nmacro, add a global variable in dbt_project.yml called \\\n`surrogate_key_treat_nulls_as_empty_strings` to your \\\ndbt_project.yml file with a value of True. \\\nThe {}.{} model triggered this warning. \\\n'.format(model.package_name, model.name) -%}\n\n{%- do exceptions.raise_compiler_error(error_message) -%}\n\n{%- endmacro -%}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7815216, "supported_languages": null}, "macro.dbt_utils.unpivot": {"name": "unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.unpivot", "macro_sql": "{% macro unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n {{ return(adapter.dispatch('unpivot', 'dbt_utils')(relation, cast_to, exclude, remove, field_name, value_name, quote_identifiers)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__unpivot"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.783008, "supported_languages": null}, "macro.dbt_utils.default__unpivot": {"name": "default__unpivot", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/sql/unpivot.sql", "original_file_path": "macros/sql/unpivot.sql", "unique_id": "macro.dbt_utils.default__unpivot", "macro_sql": "{% macro default__unpivot(relation=none, cast_to='varchar', exclude=none, remove=none, field_name='field_name', value_name='value', quote_identifiers=False) -%}\n\n {% if not relation %}\n {{ exceptions.raise_compiler_error(\"Error: argument `relation` is required for `unpivot` macro.\") }}\n {% endif %}\n\n {%- set exclude = exclude if exclude is not none else [] %}\n {%- set remove = remove if remove is not none else [] %}\n\n {%- set include_cols = [] %}\n\n {%- set table_columns = {} %}\n\n {%- do table_columns.update({relation: []}) %}\n\n {%- do dbt_utils._is_relation(relation, 'unpivot') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'unpivot') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) %}\n\n {%- for col in cols -%}\n {%- if col.column.lower() not in remove|map('lower') and col.column.lower() not in exclude|map('lower') -%}\n {% do include_cols.append(col) %}\n {%- endif %}\n {%- endfor %}\n\n\n {%- for col in include_cols -%}\n {%- set current_col_name = adapter.quote(col.column) if quote_identifiers else col.column -%}\n select\n {%- for exclude_col in exclude %}\n {{ adapter.quote(exclude_col) if quote_identifiers else exclude_col }},\n {%- endfor %}\n\n cast('{{ col.column }}' as {{ dbt.type_string() }}) as {{ adapter.quote(field_name) if quote_identifiers else field_name }},\n cast( {% if col.data_type == 'boolean' %}\n {{ dbt.cast_bool_to_text(current_col_name) }}\n {% else %}\n {{ current_col_name }}\n {% endif %}\n as {{ cast_to }}) as {{ adapter.quote(value_name) if quote_identifiers else value_name }}\n\n from {{ relation }}\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n {%- endfor -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_string", "macro.dbt.cast_bool_to_text"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7866478, "supported_languages": null}, "macro.dbt_utils.test_not_null_proportion": {"name": "test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.test_not_null_proportion", "macro_sql": "{% macro test_not_null_proportion(model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_null_proportion', 'dbt_utils')(model, group_by_columns, **kwargs)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_null_proportion"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.787534, "supported_languages": null}, "macro.dbt_utils.default__test_not_null_proportion": {"name": "default__test_not_null_proportion", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_null_proportion.sql", "original_file_path": "macros/generic_tests/not_null_proportion.sql", "unique_id": "macro.dbt_utils.default__test_not_null_proportion", "macro_sql": "{% macro default__test_not_null_proportion(model, group_by_columns) %}\n\n{% set column_name = kwargs.get('column_name', kwargs.get('arg')) %}\n{% set at_least = kwargs.get('at_least', kwargs.get('arg')) %}\n{% set at_most = kwargs.get('at_most', kwargs.get('arg', 1)) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith validation as (\n select\n {{select_gb_cols}}\n sum(case when {{ column_name }} is null then 0 else 1 end) / cast(count(*) as {{ dbt.type_numeric() }}) as not_null_proportion\n from {{ model }}\n {{groupby_gb_cols}}\n),\nvalidation_errors as (\n select\n {{select_gb_cols}}\n not_null_proportion\n from validation\n where not_null_proportion < {{ at_least }} or not_null_proportion > {{ at_most }}\n)\nselect\n *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_numeric"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.789186, "supported_languages": null}, "macro.dbt_utils.test_at_least_one": {"name": "test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.test_at_least_one", "macro_sql": "{% test at_least_one(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_at_least_one', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_at_least_one"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7901187, "supported_languages": null}, "macro.dbt_utils.default__test_at_least_one": {"name": "default__test_at_least_one", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/at_least_one.sql", "original_file_path": "macros/generic_tests/at_least_one.sql", "unique_id": "macro.dbt_utils.default__test_at_least_one", "macro_sql": "{% macro default__test_at_least_one(model, column_name, group_by_columns) %}\n\n{% set pruned_cols = [column_name] %}\n\n{% if group_by_columns|length() > 0 %}\n\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n {% set pruned_cols = group_by_columns %}\n\n {% if column_name not in pruned_cols %}\n {% do pruned_cols.append(column_name) %}\n {% endif %}\n\n{% endif %}\n\n{% set select_pruned_cols = pruned_cols|join(' ,') %}\n\nselect *\nfrom (\n with pruned_rows as (\n select\n {{ select_pruned_cols }}\n from {{ model }}\n {% if group_by_columns|length() == 0 %}\n where {{ column_name }} is not null\n limit 1\n {% endif %}\n )\n select\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count({{ column_name }}) as filler_column\n\n from pruned_rows\n\n {{groupby_gb_cols}}\n\n having count({{ column_name }}) = 0\n\n) validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7917929, "supported_languages": null}, "macro.dbt_utils.test_mutually_exclusive_ranges": {"name": "test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.test_mutually_exclusive_ranges", "macro_sql": "{% test mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n {{ return(adapter.dispatch('test_mutually_exclusive_ranges', 'dbt_utils')(model, lower_bound_column, upper_bound_column, partition_by, gaps, zero_length_range_allowed)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_mutually_exclusive_ranges"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7933528, "supported_languages": null}, "macro.dbt_utils.default__test_mutually_exclusive_ranges": {"name": "default__test_mutually_exclusive_ranges", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/mutually_exclusive_ranges.sql", "original_file_path": "macros/generic_tests/mutually_exclusive_ranges.sql", "unique_id": "macro.dbt_utils.default__test_mutually_exclusive_ranges", "macro_sql": "{% macro default__test_mutually_exclusive_ranges(model, lower_bound_column, upper_bound_column, partition_by=None, gaps='allowed', zero_length_range_allowed=False) %}\n{% if gaps == 'not_allowed' %}\n {% set allow_gaps_operator='=' %}\n {% set allow_gaps_operator_in_words='equal_to' %}\n{% elif gaps == 'allowed' %}\n {% set allow_gaps_operator='<=' %}\n {% set allow_gaps_operator_in_words='less_than_or_equal_to' %}\n{% elif gaps == 'required' %}\n {% set allow_gaps_operator='<' %}\n {% set allow_gaps_operator_in_words='less_than' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`gaps` argument for mutually_exclusive_ranges test must be one of ['not_allowed', 'allowed', 'required'] Got: '\" ~ gaps ~\"'.'\"\n ) }}\n{% endif %}\n{% if not zero_length_range_allowed %}\n {% set allow_zero_length_operator='<' %}\n {% set allow_zero_length_operator_in_words='less_than' %}\n{% elif zero_length_range_allowed %}\n {% set allow_zero_length_operator='<=' %}\n {% set allow_zero_length_operator_in_words='less_than_or_equal_to' %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`zero_length_range_allowed` argument for mutually_exclusive_ranges test must be one of [true, false] Got: '\" ~ zero_length_range_allowed ~\"'.'\"\n ) }}\n{% endif %}\n\n{% set partition_clause=\"partition by \" ~ partition_by if partition_by else '' %}\n\nwith window_functions as (\n\n select\n {% if partition_by %}\n {{ partition_by }} as partition_by_col,\n {% endif %}\n {{ lower_bound_column }} as lower_bound,\n {{ upper_bound_column }} as upper_bound,\n\n lead({{ lower_bound_column }}) over (\n {{ partition_clause }}\n order by {{ lower_bound_column }}, {{ upper_bound_column }}\n ) as next_lower_bound,\n\n row_number() over (\n {{ partition_clause }}\n order by {{ lower_bound_column }} desc, {{ upper_bound_column }} desc\n ) = 1 as is_last_record\n\n from {{ model }}\n\n),\n\ncalc as (\n -- We want to return records where one of our assumptions fails, so we'll use\n -- the `not` function with `and` statements so we can write our assumptions more cleanly\n select\n *,\n\n -- For each record: lower_bound should be < upper_bound.\n -- Coalesce it to return an error on the null case (implicit assumption\n -- these columns are not_null)\n coalesce(\n lower_bound {{ allow_zero_length_operator }} upper_bound,\n false\n ) as lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound,\n\n -- For each record: upper_bound {{ allow_gaps_operator }} the next lower_bound.\n -- Coalesce it to handle null cases for the last record.\n coalesce(\n upper_bound {{ allow_gaps_operator }} next_lower_bound,\n is_last_record,\n false\n ) as upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n\n from window_functions\n\n),\n\nvalidation_errors as (\n\n select\n *\n from calc\n\n where not(\n -- THE FOLLOWING SHOULD BE TRUE --\n lower_bound_{{ allow_zero_length_operator_in_words }}_upper_bound\n and upper_bound_{{ allow_gaps_operator_in_words }}_next_lower_bound\n )\n)\n\nselect * from validation_errors\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7968097, "supported_languages": null}, "macro.dbt_utils.test_expression_is_true": {"name": "test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.test_expression_is_true", "macro_sql": "{% test expression_is_true(model, expression, column_name=None) %}\n {{ return(adapter.dispatch('test_expression_is_true', 'dbt_utils')(model, expression, column_name)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_expression_is_true"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.797569, "supported_languages": null}, "macro.dbt_utils.default__test_expression_is_true": {"name": "default__test_expression_is_true", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/expression_is_true.sql", "original_file_path": "macros/generic_tests/expression_is_true.sql", "unique_id": "macro.dbt_utils.default__test_expression_is_true", "macro_sql": "{% macro default__test_expression_is_true(model, expression, column_name) %}\n\n{% set column_list = '*' if should_store_failures() else \"1\" %}\n\nselect\n {{ column_list }}\nfrom {{ model }}\n{% if column_name is none %}\nwhere not({{ expression }})\n{%- else %}\nwhere not({{ column_name }} {{ expression }})\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.should_store_failures"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.798334, "supported_languages": null}, "macro.dbt_utils.test_not_accepted_values": {"name": "test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.test_not_accepted_values", "macro_sql": "{% test not_accepted_values(model, column_name, values, quote=True) %}\n {{ return(adapter.dispatch('test_not_accepted_values', 'dbt_utils')(model, column_name, values, quote)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_accepted_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7991383, "supported_languages": null}, "macro.dbt_utils.default__test_not_accepted_values": {"name": "default__test_not_accepted_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_accepted_values.sql", "original_file_path": "macros/generic_tests/not_accepted_values.sql", "unique_id": "macro.dbt_utils.default__test_not_accepted_values", "macro_sql": "{% macro default__test_not_accepted_values(model, column_name, values, quote=True) %}\nwith all_values as (\n\n select distinct\n {{ column_name }} as value_field\n\n from {{ model }}\n\n),\n\nvalidation_errors as (\n\n select\n value_field\n\n from all_values\n where value_field in (\n {% for value in values -%}\n {% if quote -%}\n '{{ value }}'\n {%- else -%}\n {{ value }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {%- endfor %}\n )\n\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.7999241, "supported_languages": null}, "macro.dbt_utils.test_relationships_where": {"name": "test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.test_relationships_where", "macro_sql": "{% test relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n {{ return(adapter.dispatch('test_relationships_where', 'dbt_utils')(model, column_name, to, field, from_condition, to_condition)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_relationships_where"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8008049, "supported_languages": null}, "macro.dbt_utils.default__test_relationships_where": {"name": "default__test_relationships_where", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/relationships_where.sql", "original_file_path": "macros/generic_tests/relationships_where.sql", "unique_id": "macro.dbt_utils.default__test_relationships_where", "macro_sql": "{% macro default__test_relationships_where(model, column_name, to, field, from_condition=\"1=1\", to_condition=\"1=1\") %}\n\n{# T-SQL has no boolean data type so we use 1=1 which returns TRUE #}\n{# ref https://stackoverflow.com/a/7170753/3842610 #}\n\nwith left_table as (\n\n select\n {{column_name}} as id\n\n from {{model}}\n\n where {{column_name}} is not null\n and {{from_condition}}\n\n),\n\nright_table as (\n\n select\n {{field}} as id\n\n from {{to}}\n\n where {{field}} is not null\n and {{to_condition}}\n\n),\n\nexceptions as (\n\n select\n left_table.id,\n right_table.id as right_id\n\n from left_table\n\n left join right_table\n on left_table.id = right_table.id\n\n where right_table.id is null\n\n)\n\nselect * from exceptions\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.80149, "supported_languages": null}, "macro.dbt_utils.test_fewer_rows_than": {"name": "test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.test_fewer_rows_than", "macro_sql": "{% test fewer_rows_than(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_fewer_rows_than', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_fewer_rows_than"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8025455, "supported_languages": null}, "macro.dbt_utils.default__test_fewer_rows_than": {"name": "default__test_fewer_rows_than", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/fewer_rows_than.sql", "original_file_path": "macros/generic_tests/fewer_rows_than.sql", "unique_id": "macro.dbt_utils.default__test_fewer_rows_than", "macro_sql": "{% macro default__test_fewer_rows_than(model, compare_model, group_by_columns) %}\n\n{{ config(fail_calc = 'sum(coalesce(row_count_delta, 0))') }}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in equal_rowcount. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_fewer_rows_than'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_our_model \n from {{ model }}\n {{ groupby_gb_cols }}\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_fewer_rows_than,\n count(*) as count_comparison_model \n from {{ compare_model }}\n {{ groupby_gb_cols }}\n\n),\ncounts as (\n\n select\n\n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_our_model,\n count_comparison_model\n from a\n full join b on \n a.id_dbtutils_test_fewer_rows_than = b.id_dbtutils_test_fewer_rows_than\n {{ join_gb_cols }}\n\n),\nfinal as (\n\n select *,\n case\n -- fail the test if we have more rows than the reference model and return the row count delta\n when count_our_model > count_comparison_model then (count_our_model - count_comparison_model)\n -- fail the test if they are the same number\n when count_our_model = count_comparison_model then 1\n -- pass the test if the delta is positive (i.e. return the number 0)\n else 0\n end as row_count_delta\n from counts\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.804556, "supported_languages": null}, "macro.dbt_utils.test_equal_rowcount": {"name": "test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.test_equal_rowcount", "macro_sql": "{% test equal_rowcount(model, compare_model, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_equal_rowcount', 'dbt_utils')(model, compare_model, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equal_rowcount"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8056743, "supported_languages": null}, "macro.dbt_utils.default__test_equal_rowcount": {"name": "default__test_equal_rowcount", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equal_rowcount.sql", "original_file_path": "macros/generic_tests/equal_rowcount.sql", "unique_id": "macro.dbt_utils.default__test_equal_rowcount", "macro_sql": "{% macro default__test_equal_rowcount(model, compare_model, group_by_columns) %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = 'sum(coalesce(diff_count, 0))') }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(', ') + ', ' %}\n {% set join_gb_cols %}\n {% for c in group_by_columns %}\n and a.{{c}} = b.{{c}}\n {% endfor %}\n {% endset %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n{#-- We must add a fake join key in case additional grouping variables are not provided --#}\n{#-- Redshift does not allow for dynamically created join conditions (e.g. full join on 1 = 1 --#}\n{#-- The same logic is used in fewer_rows_than. In case of changes, maintain consistent logic --#}\n{% set group_by_columns = ['id_dbtutils_test_equal_rowcount'] + group_by_columns %}\n{% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n\nwith a as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_a \n from {{ model }}\n {{groupby_gb_cols}}\n\n\n),\nb as (\n\n select \n {{select_gb_cols}}\n 1 as id_dbtutils_test_equal_rowcount,\n count(*) as count_b \n from {{ compare_model }}\n {{groupby_gb_cols}}\n\n),\nfinal as (\n\n select\n \n {% for c in group_by_columns -%}\n a.{{c}} as {{c}}_a,\n b.{{c}} as {{c}}_b,\n {% endfor %}\n\n count_a,\n count_b,\n abs(count_a - count_b) as diff_count\n\n from a\n full join b\n on\n a.id_dbtutils_test_equal_rowcount = b.id_dbtutils_test_equal_rowcount\n {{join_gb_cols}}\n\n\n)\n\nselect * from final\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8077881, "supported_languages": null}, "macro.dbt_utils.test_not_empty_string": {"name": "test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.test_not_empty_string", "macro_sql": "{% test not_empty_string(model, column_name, trim_whitespace=true) %}\n\n {{ return(adapter.dispatch('test_not_empty_string', 'dbt_utils')(model, column_name, trim_whitespace)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_empty_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8086119, "supported_languages": null}, "macro.dbt_utils.default__test_not_empty_string": {"name": "default__test_not_empty_string", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_empty_string.sql", "original_file_path": "macros/generic_tests/not_empty_string.sql", "unique_id": "macro.dbt_utils.default__test_not_empty_string", "macro_sql": "{% macro default__test_not_empty_string(model, column_name, trim_whitespace=true) %}\n\n with\n \n all_values as (\n\n select \n\n\n {% if trim_whitespace == true -%}\n\n trim({{ column_name }}) as {{ column_name }}\n\n {%- else -%}\n\n {{ column_name }}\n\n {%- endif %}\n \n from {{ model }}\n\n ),\n\n errors as (\n\n select * from all_values\n where {{ column_name }} = ''\n\n )\n\n select * from errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8092475, "supported_languages": null}, "macro.dbt_utils.test_cardinality_equality": {"name": "test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.test_cardinality_equality", "macro_sql": "{% test cardinality_equality(model, column_name, to, field) %}\n {{ return(adapter.dispatch('test_cardinality_equality', 'dbt_utils')(model, column_name, to, field)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_cardinality_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8100214, "supported_languages": null}, "macro.dbt_utils.default__test_cardinality_equality": {"name": "default__test_cardinality_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/cardinality_equality.sql", "original_file_path": "macros/generic_tests/cardinality_equality.sql", "unique_id": "macro.dbt_utils.default__test_cardinality_equality", "macro_sql": "{% macro default__test_cardinality_equality(model, column_name, to, field) %}\n\n{# T-SQL does not let you use numbers as aliases for columns #}\n{# Thus, no \"GROUP BY 1\" #}\n\nwith table_a as (\nselect\n {{ column_name }},\n count(*) as num_rows\nfrom {{ model }}\ngroup by {{ column_name }}\n),\n\ntable_b as (\nselect\n {{ field }},\n count(*) as num_rows\nfrom {{ to }}\ngroup by {{ field }}\n),\n\nexcept_a as (\n select *\n from table_a\n {{ dbt.except() }}\n select *\n from table_b\n),\n\nexcept_b as (\n select *\n from table_b\n {{ dbt.except() }}\n select *\n from table_a\n),\n\nunioned as (\n select *\n from except_a\n union all\n select *\n from except_b\n)\n\nselect *\nfrom unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8107078, "supported_languages": null}, "macro.dbt_utils.test_sequential_values": {"name": "test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.test_sequential_values", "macro_sql": "{% test sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n {{ return(adapter.dispatch('test_sequential_values', 'dbt_utils')(model, column_name, interval, datepart, group_by_columns)) }}\n\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_sequential_values"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8117478, "supported_languages": null}, "macro.dbt_utils.default__test_sequential_values": {"name": "default__test_sequential_values", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/sequential_values.sql", "original_file_path": "macros/generic_tests/sequential_values.sql", "unique_id": "macro.dbt_utils.default__test_sequential_values", "macro_sql": "{% macro default__test_sequential_values(model, column_name, interval=1, datepart=None, group_by_columns = []) %}\n\n{% set previous_column_name = \"previous_\" ~ dbt_utils.slugify(column_name) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(',') + ', ' %}\n {% set partition_gb_cols = 'partition by ' + group_by_columns|join(',') %}\n{% endif %}\n\nwith windowed as (\n\n select\n {{ select_gb_cols }}\n {{ column_name }},\n lag({{ column_name }}) over (\n {{partition_gb_cols}}\n order by {{ column_name }}\n ) as {{ previous_column_name }}\n from {{ model }}\n),\n\nvalidation_errors as (\n select\n *\n from windowed\n {% if datepart %}\n where not(cast({{ column_name }} as {{ dbt.type_timestamp() }})= cast({{ dbt.dateadd(datepart, interval, previous_column_name) }} as {{ dbt.type_timestamp() }}))\n {% else %}\n where not({{ column_name }} = {{ previous_column_name }} + {{ interval }})\n {% endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.slugify", "macro.dbt.type_timestamp", "macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8136747, "supported_languages": null}, "macro.dbt_utils.test_recency": {"name": "test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.test_recency", "macro_sql": "{% test recency(model, field, datepart, interval, ignore_time_component=False, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_recency', 'dbt_utils')(model, field, datepart, interval, ignore_time_component, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_recency"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8147469, "supported_languages": null}, "macro.dbt_utils.default__test_recency": {"name": "default__test_recency", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/recency.sql", "original_file_path": "macros/generic_tests/recency.sql", "unique_id": "macro.dbt_utils.default__test_recency", "macro_sql": "{% macro default__test_recency(model, field, datepart, interval, ignore_time_component, group_by_columns) %}\n\n{% set empty_invocation = flags.EMPTY is defined and flags.EMPTY %}\n\n{% set threshold = 'cast(' ~ dbt.dateadd(datepart, interval * -1, dbt.current_timestamp()) ~ ' as ' ~ ('date' if ignore_time_component else dbt.type_timestamp()) ~ ')' %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nwith recency as (\n\n select \n\n {{ select_gb_cols }}\n {% if ignore_time_component %}\n cast(max({{ field }}) as date) as most_recent\n {%- else %}\n max({{ field }}) as most_recent\n {%- endif %}\n\n from {{ model }}\n\n {{ groupby_gb_cols }}\n\n)\n\nselect\n\n {{ select_gb_cols }}\n most_recent,\n {{ threshold }} as threshold\n\nfrom recency\nwhere most_recent < {{ threshold }}\n{%- if not empty_invocation %}\n or most_recent is null\n{%- endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd", "macro.dbt.current_timestamp", "macro.dbt.type_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8166301, "supported_languages": null}, "macro.dbt_utils.test_equality": {"name": "test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.test_equality", "macro_sql": "{% test equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n {{ return(adapter.dispatch('test_equality', 'dbt_utils')(model, compare_model, compare_columns, exclude_columns, precision)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_equality"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8187776, "supported_languages": null}, "macro.dbt_utils.default__test_equality": {"name": "default__test_equality", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/equality.sql", "original_file_path": "macros/generic_tests/equality.sql", "unique_id": "macro.dbt_utils.default__test_equality", "macro_sql": "{% macro default__test_equality(model, compare_model, compare_columns=None, exclude_columns=None, precision = None) %}\n\n{%- if compare_columns and exclude_columns -%}\n {{ exceptions.raise_compiler_error(\"Both a compare and an ignore list were provided to the `equality` macro. Only one is allowed\") }}\n{%- endif -%}\n\n{% set set_diff %}\n count(*) + coalesce(abs(\n sum(case when which_diff = 'a_minus_b' then 1 else 0 end) -\n sum(case when which_diff = 'b_minus_a' then 1 else 0 end)\n ), 0)\n{% endset %}\n\n{#-- Needs to be set at parse time, before we return '' below --#}\n{{ config(fail_calc = set_diff) }}\n\n{#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. #}\n{%- if not execute -%}\n {{ return('') }}\n{% endif %}\n\n\n\n-- setup\n{%- do dbt_utils._is_relation(model, 'test_equality') -%}\n\n{# Ensure there are no extra columns in the compare_model vs model #}\n{%- if not compare_columns -%}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- do dbt_utils._is_ephemeral(compare_model, 'test_equality') -%}\n\n {%- set model_columns = adapter.get_columns_in_relation(model) -%}\n {%- set compare_model_columns = adapter.get_columns_in_relation(compare_model) -%}\n\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- set include_model_columns = [] %}\n {%- for column in model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n {%- for column in compare_model_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_model_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns_set = set(include_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(include_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- else -%}\n {%- set compare_columns_set = set(model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- set compare_model_columns_set = set(compare_model_columns | map(attribute='quoted') | map(\"lower\")) %}\n {%- endif -%}\n\n {% if compare_columns_set != compare_model_columns_set %}\n {{ exceptions.raise_compiler_error(compare_model ~\" has less columns than \" ~ model ~ \", please ensure they have the same columns or use the `compare_columns` or `exclude_columns` arguments to subset them.\") }}\n {% endif %}\n\n\n{% endif %}\n\n{%- if not precision -%}\n {%- if not compare_columns -%}\n {# \n You cannot get the columns in an ephemeral model (due to not existing in the information schema),\n so if the user does not provide an explicit list of columns we must error in the case it is ephemeral\n #}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set compare_columns = adapter.get_columns_in_relation(model)-%}\n\n {%- if exclude_columns -%}\n {#-- Lower case ignore columns for easier comparison --#}\n {%- set exclude_columns = exclude_columns | map(\"lower\") | list %}\n\n {# Filter out the excluded columns #}\n {%- set include_columns = [] %}\n {%- for column in compare_columns -%}\n {%- if column.name | lower not in exclude_columns -%}\n {% do include_columns.append(column) %}\n {%- endif %}\n {%- endfor %}\n\n {%- set compare_columns = include_columns | map(attribute='quoted') %}\n {%- else -%} {# Compare columns provided #}\n {%- set compare_columns = compare_columns | map(attribute='quoted') %}\n {%- endif -%}\n {%- endif -%}\n\n {% set compare_cols_csv = compare_columns | join(', ') %}\n\n{% else %} {# Precision required #}\n {#-\n If rounding is required, we need to get the types, so it cannot be ephemeral even if they provide column names\n -#}\n {%- do dbt_utils._is_ephemeral(model, 'test_equality') -%}\n {%- set columns = adapter.get_columns_in_relation(model) -%}\n\n {% set columns_list = [] %}\n {%- for col in columns -%}\n {%- if (\n (col.name|lower in compare_columns|map('lower') or not compare_columns) and\n (col.name|lower not in exclude_columns|map('lower') or not exclude_columns)\n ) -%}\n {# Databricks double type is not picked up by any number type checks in dbt #}\n {%- if col.is_float() or col.is_numeric() or col.data_type == 'double' -%}\n {# Cast is required due to postgres not having round for a double precision number #}\n {%- do columns_list.append('round(cast(' ~ col.quoted ~ ' as ' ~ dbt.type_numeric() ~ '),' ~ precision ~ ') as ' ~ col.quoted) -%}\n {%- else -%} {# Non-numeric type #}\n {%- do columns_list.append(col.quoted) -%}\n {%- endif -%}\n {% endif %}\n {%- endfor -%}\n\n {% set compare_cols_csv = columns_list | join(', ') %}\n\n{% endif %}\n\nwith a as (\n\n select * from {{ model }}\n\n),\n\nb as (\n\n select * from {{ compare_model }}\n\n),\n\na_minus_b as (\n\n select {{compare_cols_csv}} from a\n {{ dbt.except() }}\n select {{compare_cols_csv}} from b\n\n),\n\nb_minus_a as (\n\n select {{compare_cols_csv}} from b\n {{ dbt.except() }}\n select {{compare_cols_csv}} from a\n\n),\n\nunioned as (\n\n select 'a_minus_b' as which_diff, a_minus_b.* from a_minus_b\n union all\n select 'b_minus_a' as which_diff, b_minus_a.* from b_minus_a\n\n)\n\nselect * from unioned\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.type_numeric", "macro.dbt.except"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8266644, "supported_languages": null}, "macro.dbt_utils.test_unique_combination_of_columns": {"name": "test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.test_unique_combination_of_columns", "macro_sql": "{% test unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n {{ return(adapter.dispatch('test_unique_combination_of_columns', 'dbt_utils')(model, combination_of_columns, quote_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_unique_combination_of_columns"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8275785, "supported_languages": null}, "macro.dbt_utils.default__test_unique_combination_of_columns": {"name": "default__test_unique_combination_of_columns", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/unique_combination_of_columns.sql", "original_file_path": "macros/generic_tests/unique_combination_of_columns.sql", "unique_id": "macro.dbt_utils.default__test_unique_combination_of_columns", "macro_sql": "{% macro default__test_unique_combination_of_columns(model, combination_of_columns, quote_columns=false) %}\n\n{% if not quote_columns %}\n {%- set column_list=combination_of_columns %}\n{% elif quote_columns %}\n {%- set column_list=[] %}\n {% for column in combination_of_columns -%}\n {% do column_list.append( adapter.quote(column) ) %}\n {%- endfor %}\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"`quote_columns` argument for unique_combination_of_columns test must be one of [True, False] Got: '\" ~ quote ~\"'.'\"\n ) }}\n{% endif %}\n\n{%- set columns_csv=column_list | join(', ') %}\n\n\nwith validation_errors as (\n\n select\n {{ columns_csv }}\n from {{ model }}\n group by {{ columns_csv }}\n having count(*) > 1\n\n)\n\nselect *\nfrom validation_errors\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8288693, "supported_languages": null}, "macro.dbt_utils.test_accepted_range": {"name": "test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.test_accepted_range", "macro_sql": "{% test accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n {{ return(adapter.dispatch('test_accepted_range', 'dbt_utils')(model, column_name, min_value, max_value, inclusive)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_accepted_range"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8297818, "supported_languages": null}, "macro.dbt_utils.default__test_accepted_range": {"name": "default__test_accepted_range", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/accepted_range.sql", "original_file_path": "macros/generic_tests/accepted_range.sql", "unique_id": "macro.dbt_utils.default__test_accepted_range", "macro_sql": "{% macro default__test_accepted_range(model, column_name, min_value=none, max_value=none, inclusive=true) %}\n\nwith meet_condition as(\n select *\n from {{ model }}\n),\n\nvalidation_errors as (\n select *\n from meet_condition\n where\n -- never true, defaults to an empty result set. Exists to ensure any combo of the `or` clauses below succeeds\n 1 = 2\n\n {%- if min_value is not none %}\n -- records with a value >= min_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} > {{- \"=\" if inclusive }} {{ min_value }}\n {%- endif %}\n\n {%- if max_value is not none %}\n -- records with a value <= max_value are permitted. The `not` flips this to find records that don't meet the rule.\n or not {{ column_name }} < {{- \"=\" if inclusive }} {{ max_value }}\n {%- endif %}\n)\n\nselect *\nfrom validation_errors\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8307128, "supported_languages": null}, "macro.dbt_utils.test_not_constant": {"name": "test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.test_not_constant", "macro_sql": "{% test not_constant(model, column_name, group_by_columns = []) %}\n {{ return(adapter.dispatch('test_not_constant', 'dbt_utils')(model, column_name, group_by_columns)) }}\n{% endtest %}", "depends_on": {"macros": ["macro.dbt_utils.default__test_not_constant"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8315208, "supported_languages": null}, "macro.dbt_utils.default__test_not_constant": {"name": "default__test_not_constant", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/generic_tests/not_constant.sql", "original_file_path": "macros/generic_tests/not_constant.sql", "unique_id": "macro.dbt_utils.default__test_not_constant", "macro_sql": "{% macro default__test_not_constant(model, column_name, group_by_columns) %}\n\n{% if group_by_columns|length() > 0 %}\n {% set select_gb_cols = group_by_columns|join(' ,') + ', ' %}\n {% set groupby_gb_cols = 'group by ' + group_by_columns|join(',') %}\n{% endif %}\n\n\nselect\n {# In TSQL, subquery aggregate columns need aliases #}\n {# thus: a filler col name, 'filler_column' #}\n {{select_gb_cols}}\n count(distinct {{ column_name }}) as filler_column\n\nfrom {{ model }}\n\n {{groupby_gb_cols}}\n\nhaving count(distinct {{ column_name }}) = 1\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8324494, "supported_languages": null}, "macro.dbt_utils.get_url_path": {"name": "get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.get_url_path", "macro_sql": "{% macro get_url_path(field) -%}\n {{ return(adapter.dispatch('get_url_path', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_path"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8331397, "supported_languages": null}, "macro.dbt_utils.default__get_url_path": {"name": "default__get_url_path", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_path.sql", "original_file_path": "macros/web/get_url_path.sql", "unique_id": "macro.dbt_utils.default__get_url_path", "macro_sql": "{% macro default__get_url_path(field) -%}\n\n {%- set stripped_url =\n dbt.replace(\n dbt.replace(field, \"'http://'\", \"''\"), \"'https://'\", \"''\")\n -%}\n\n {%- set first_slash_pos -%}\n coalesce(\n nullif({{ dbt.position(\"'/'\", stripped_url) }}, 0),\n {{ dbt.position(\"'?'\", stripped_url) }} - 1\n )\n {%- endset -%}\n\n {%- set parsed_path =\n dbt.split_part(\n dbt.right(\n stripped_url,\n dbt.length(stripped_url) ~ \"-\" ~ first_slash_pos\n ),\n \"'?'\", 1\n )\n -%}\n\n {{ dbt.safe_cast(\n parsed_path,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.replace", "macro.dbt.position", "macro.dbt.split_part", "macro.dbt.right", "macro.dbt.length", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8344026, "supported_languages": null}, "macro.dbt_utils.get_url_host": {"name": "get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.get_url_host", "macro_sql": "{% macro get_url_host(field) -%}\n {{ return(adapter.dispatch('get_url_host', 'dbt_utils')(field)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_host"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.835006, "supported_languages": null}, "macro.dbt_utils.default__get_url_host": {"name": "default__get_url_host", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_host.sql", "original_file_path": "macros/web/get_url_host.sql", "unique_id": "macro.dbt_utils.default__get_url_host", "macro_sql": "{% macro default__get_url_host(field) -%}\n\n{%- set parsed =\n dbt.split_part(\n dbt.split_part(\n dbt.replace(\n dbt.replace(\n dbt.replace(field, \"'android-app://'\", \"''\"\n ), \"'http://'\", \"''\"\n ), \"'https://'\", \"''\"\n ), \"'/'\", 1\n ), \"'?'\", 1\n )\n\n-%}\n\n\n {{ dbt.safe_cast(\n parsed,\n dbt.type_string()\n )}}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part", "macro.dbt.replace", "macro.dbt.safe_cast", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8359134, "supported_languages": null}, "macro.dbt_utils.get_url_parameter": {"name": "get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.get_url_parameter", "macro_sql": "{% macro get_url_parameter(field, url_parameter) -%}\n {{ return(adapter.dispatch('get_url_parameter', 'dbt_utils')(field, url_parameter)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8364975, "supported_languages": null}, "macro.dbt_utils.default__get_url_parameter": {"name": "default__get_url_parameter", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/web/get_url_parameter.sql", "original_file_path": "macros/web/get_url_parameter.sql", "unique_id": "macro.dbt_utils.default__get_url_parameter", "macro_sql": "{% macro default__get_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"='\" -%}\n\n{%- set split = dbt.split_part(dbt.split_part(field, formatted_url_parameter, 2), \"'&'\", 1) -%}\n\nnullif({{ split }},'')\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt.split_part"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.837145, "supported_languages": null}, "macro.dbt_utils.pretty_time": {"name": "pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.pretty_time", "macro_sql": "{% macro pretty_time(format='%H:%M:%S') %}\n {{ return(adapter.dispatch('pretty_time', 'dbt_utils')(format)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8376744, "supported_languages": null}, "macro.dbt_utils.default__pretty_time": {"name": "default__pretty_time", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_time.sql", "original_file_path": "macros/jinja_helpers/pretty_time.sql", "unique_id": "macro.dbt_utils.default__pretty_time", "macro_sql": "{% macro default__pretty_time(format='%H:%M:%S') %}\n {{ return(modules.datetime.datetime.now().strftime(format)) }}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8380678, "supported_languages": null}, "macro.dbt_utils.log_info": {"name": "log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.log_info", "macro_sql": "{% macro log_info(message) %}\n {{ return(adapter.dispatch('log_info', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__log_info"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.838547, "supported_languages": null}, "macro.dbt_utils.default__log_info": {"name": "default__log_info", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/log_info.sql", "original_file_path": "macros/jinja_helpers/log_info.sql", "unique_id": "macro.dbt_utils.default__log_info", "macro_sql": "{% macro default__log_info(message) %}\n {{ log(dbt_utils.pretty_log_format(message), info=True) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8390396, "supported_languages": null}, "macro.dbt_utils._is_ephemeral": {"name": "_is_ephemeral", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_ephemeral.sql", "original_file_path": "macros/jinja_helpers/_is_ephemeral.sql", "unique_id": "macro.dbt_utils._is_ephemeral", "macro_sql": "{% macro _is_ephemeral(obj, macro) %}\n {%- if obj.is_cte -%}\n {% set ephemeral_prefix = api.Relation.add_ephemeral_prefix('') %}\n {% if obj.name.startswith(ephemeral_prefix) %}\n {% set model_name = obj.name[(ephemeral_prefix|length):] %}\n {% else %}\n {% set model_name = obj.name %}\n {%- endif -%}\n {% set error_message %}\nThe `{{ macro }}` macro cannot be used with ephemeral models, as it relies on the information schema.\n\n`{{ model_name }}` is an ephemeral model. Consider making it a view or table instead.\n {% endset %}\n {%- do exceptions.raise_compiler_error(error_message) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8404498, "supported_languages": null}, "macro.dbt_utils.pretty_log_format": {"name": "pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.pretty_log_format", "macro_sql": "{% macro pretty_log_format(message) %}\n {{ return(adapter.dispatch('pretty_log_format', 'dbt_utils')(message)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.default__pretty_log_format"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8409894, "supported_languages": null}, "macro.dbt_utils.default__pretty_log_format": {"name": "default__pretty_log_format", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/pretty_log_format.sql", "original_file_path": "macros/jinja_helpers/pretty_log_format.sql", "unique_id": "macro.dbt_utils.default__pretty_log_format", "macro_sql": "{% macro default__pretty_log_format(message) %}\n {{ return( dbt_utils.pretty_time() ~ ' + ' ~ message) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.pretty_time"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8413193, "supported_languages": null}, "macro.dbt_utils._is_relation": {"name": "_is_relation", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/_is_relation.sql", "original_file_path": "macros/jinja_helpers/_is_relation.sql", "unique_id": "macro.dbt_utils._is_relation", "macro_sql": "{% macro _is_relation(obj, macro) %}\n {%- if not (obj is mapping and obj.get('metadata', {}).get('type', '').endswith('Relation')) -%}\n {%- do exceptions.raise_compiler_error(\"Macro \" ~ macro ~ \" expected a Relation but received the value: \" ~ obj) -%}\n {%- endif -%}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.842203, "supported_languages": null}, "macro.dbt_utils.slugify": {"name": "slugify", "resource_type": "macro", "package_name": "dbt_utils", "path": "macros/jinja_helpers/slugify.sql", "original_file_path": "macros/jinja_helpers/slugify.sql", "unique_id": "macro.dbt_utils.slugify", "macro_sql": "{% macro slugify(string) %}\n\n{% if not string %}\n{{ return('') }}\n{% endif %}\n\n{#- Lower case the string -#}\n{% set string = string | lower %}\n{#- Replace spaces and dashes with underscores -#}\n{% set string = modules.re.sub('[ -]+', '_', string) %}\n{#- Only take letters, numbers, and underscores -#}\n{% set string = modules.re.sub('[^a-z0-9_]+', '', string) %}\n{#- Prepends \"_\" if string begins with a number -#}\n{% set string = modules.re.sub('^[0-9]', '_' + string[0], string) %}\n\n{{ return(string) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.843623, "supported_languages": null}, "macro.fivetran_utils.try_cast": {"name": "try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.try_cast", "macro_sql": "{% macro try_cast(field, type) %}\n {{ adapter.dispatch('try_cast', 'fivetran_utils') (field, type) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__try_cast"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8446007, "supported_languages": null}, "macro.fivetran_utils.default__try_cast": {"name": "default__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.default__try_cast", "macro_sql": "{% macro default__try_cast(field, type) %}\n {# most databases don't support this function yet\n so we just need to use cast #}\n cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8449087, "supported_languages": null}, "macro.fivetran_utils.redshift__try_cast": {"name": "redshift__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.redshift__try_cast", "macro_sql": "{% macro redshift__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when trim({{field}}) ~ '^(0|[1-9][0-9]*)$' then trim({{field}})\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8454585, "supported_languages": null}, "macro.fivetran_utils.postgres__try_cast": {"name": "postgres__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.postgres__try_cast", "macro_sql": "{% macro postgres__try_cast(field, type) %}\n{%- if type == 'numeric' -%}\n\n case\n when replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar)) ~ '^(0|[1-9][0-9]*)$' \n then replace(cast({{field}} as varchar),cast(' ' as varchar),cast('' as varchar))\n else null\n end::{{type}}\n\n{% else %}\n {{ exceptions.raise_compiler_error(\n \"non-numeric datatypes are not currently supported\") }}\n\n{% endif %}\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.84605, "supported_languages": null}, "macro.fivetran_utils.snowflake__try_cast": {"name": "snowflake__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.snowflake__try_cast", "macro_sql": "{% macro snowflake__try_cast(field, type) %}\n try_cast(cast({{field}} as varchar) as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.846314, "supported_languages": null}, "macro.fivetran_utils.bigquery__try_cast": {"name": "bigquery__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.bigquery__try_cast", "macro_sql": "{% macro bigquery__try_cast(field, type) %}\n safe_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8465674, "supported_languages": null}, "macro.fivetran_utils.spark__try_cast": {"name": "spark__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.spark__try_cast", "macro_sql": "{% macro spark__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8468213, "supported_languages": null}, "macro.fivetran_utils.sqlserver__try_cast": {"name": "sqlserver__try_cast", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/try_cast.sql", "original_file_path": "macros/try_cast.sql", "unique_id": "macro.fivetran_utils.sqlserver__try_cast", "macro_sql": "{% macro sqlserver__try_cast(field, type) %}\n try_cast({{field}} as {{type}})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8471098, "supported_languages": null}, "macro.fivetran_utils.union_relations": {"name": "union_relations", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_relations", "macro_sql": "{%- macro union_relations(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n {%- set source_column_name = source_column_name if source_column_name is not none else '_dbt_source_relation' -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column in exclude -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column not in include -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n cast({{ dbt.string_literal(relation) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n\n from {{ aliases[loop.index0] if aliases else relation }}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8528516, "supported_languages": null}, "macro.fivetran_utils.union_tables": {"name": "union_tables", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations.sql", "original_file_path": "macros/union_relations.sql", "unique_id": "macro.fivetran_utils.union_tables", "macro_sql": "{%- macro union_tables(tables, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_table') -%}\n\n {%- do exceptions.warn(\"Warning: the `union_tables` macro is no longer supported and will be deprecated in a future release of dbt-utils. Use the `union_relations` macro instead\") -%}\n\n {{ return(dbt_utils.union_relations(tables, column_override, include, exclude, source_column_name)) }}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8535786, "supported_languages": null}, "macro.fivetran_utils.pivot_json_extract": {"name": "pivot_json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/pivot_json_extract.sql", "original_file_path": "macros/pivot_json_extract.sql", "unique_id": "macro.fivetran_utils.pivot_json_extract", "macro_sql": "{% macro pivot_json_extract(string, list_of_properties) %}\n\n{%- for property in list_of_properties -%}\n{%- if property is mapping -%}\nreplace( {{ fivetran_utils.json_extract(string, property.name) }}, '\"', '') as {{ property.alias if property.alias else property.name | replace(' ', '_') | replace('.', '_') | lower }}\n\n{%- else -%}\nreplace( {{ fivetran_utils.json_extract(string, property) }}, '\"', '') as {{ property | replace(' ', '_') | lower }}\n\n{%- endif -%}\n{%- if not loop.last -%},{%- endif %}\n{% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8550882, "supported_languages": null}, "macro.fivetran_utils.calculated_fields": {"name": "calculated_fields", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/calculated_fields.sql", "original_file_path": "macros/calculated_fields.sql", "unique_id": "macro.fivetran_utils.calculated_fields", "macro_sql": "{% macro calculated_fields(variable) -%}\n\n{% if var(variable, none) %}\n {% for field in var(variable) %}\n , {{ field.transform_sql }} as {{ field.name }} \n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8558128, "supported_languages": null}, "macro.fivetran_utils.collect_freshness": {"name": "collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.collect_freshness", "macro_sql": "{% macro collect_freshness(source, loaded_at_field, filter) %}\n {{ return(adapter.dispatch('collect_freshness')(source, loaded_at_field, filter))}}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__collect_freshness"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.856777, "supported_languages": null}, "macro.fivetran_utils.default__collect_freshness": {"name": "default__collect_freshness", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/collect_freshness.sql", "original_file_path": "macros/collect_freshness.sql", "unique_id": "macro.fivetran_utils.default__collect_freshness", "macro_sql": "{% macro default__collect_freshness(source, loaded_at_field, filter) %}\n {% call statement('collect_freshness', fetch_result=True, auto_begin=False) -%}\n\n {%- set enabled_array = [] -%}\n {% for node in graph.sources.values() %}\n {% if node.identifier == source.identifier %}\n {% if (node.meta['is_enabled'] | default(true)) %}\n {%- do enabled_array.append(1) -%}\n {% endif %}\n {% endif %}\n {% endfor %}\n {% set is_enabled = (enabled_array != []) %}\n\n select\n {% if is_enabled %}\n max({{ loaded_at_field }})\n {% else %} \n {{ current_timestamp() }} {% endif %} as max_loaded_at,\n {{ current_timestamp() }} as snapshotted_at\n\n {% if is_enabled %}\n from {{ source }}\n {% if filter %}\n where {{ filter }}\n {% endif %}\n {% endif %}\n\n {% endcall %}\n\n {% if dbt_version.split('.') | map('int') | list >= [1, 5, 0] %}\n {{ return(load_result('collect_freshness')) }}\n {% else %}\n {{ return(load_result('collect_freshness').table) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.statement", "macro.dbt.current_timestamp"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8592117, "supported_languages": null}, "macro.fivetran_utils.snowflake_seed_data": {"name": "snowflake_seed_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/snowflake_seed_data.sql", "original_file_path": "macros/snowflake_seed_data.sql", "unique_id": "macro.fivetran_utils.snowflake_seed_data", "macro_sql": "{% macro snowflake_seed_data(seed_name) %}\n\n{% if target.type == 'snowflake' %}\n{{ return(ref(seed_name ~ '_snowflake')) }}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8599923, "supported_languages": null}, "macro.fivetran_utils.json_extract": {"name": "json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.json_extract", "macro_sql": "{% macro json_extract(string, string_path) -%}\n\n{{ adapter.dispatch('json_extract', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_extract"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.860758, "supported_languages": null}, "macro.fivetran_utils.default__json_extract": {"name": "default__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.default__json_extract", "macro_sql": "{% macro default__json_extract(string, string_path) %}\n\n json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} )\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8611002, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_extract": {"name": "snowflake__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.snowflake__json_extract", "macro_sql": "{% macro snowflake__json_extract(string, string_path) %}\n\n json_extract_path_text(try_parse_json( {{string}} ), {{ \"'\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8614519, "supported_languages": null}, "macro.fivetran_utils.redshift__json_extract": {"name": "redshift__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.redshift__json_extract", "macro_sql": "{% macro redshift__json_extract(string, string_path) %}\n\n case when is_valid_json( {{string}} ) then json_extract_path_text({{string}}, {{ \"'\" ~ string_path ~ \"'\" }} ) else null end\n \n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8618004, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_extract": {"name": "bigquery__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.bigquery__json_extract", "macro_sql": "{% macro bigquery__json_extract(string, string_path) %}\n\n json_extract_scalar({{string}}, {{ \"'$.\" ~ string_path ~ \"'\" }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.862139, "supported_languages": null}, "macro.fivetran_utils.postgres__json_extract": {"name": "postgres__json_extract", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_extract.sql", "original_file_path": "macros/json_extract.sql", "unique_id": "macro.fivetran_utils.postgres__json_extract", "macro_sql": "{% macro postgres__json_extract(string, string_path) %}\n\n {{string}}::json->>{{\"'\" ~ string_path ~ \"'\" }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8624432, "supported_languages": null}, "macro.fivetran_utils.enabled_vars": {"name": "enabled_vars", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars.sql", "original_file_path": "macros/enabled_vars.sql", "unique_id": "macro.fivetran_utils.enabled_vars", "macro_sql": "{% macro enabled_vars(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, True) == False %}\n {{ return(False) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(True) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8632185, "supported_languages": null}, "macro.fivetran_utils.union_data": {"name": "union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.union_data", "macro_sql": "{%- macro union_data(table_identifier, database_variable, schema_variable, default_database, default_schema, default_variable, union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('union_data', 'fivetran_utils') (\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.default__union_data"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8654249, "supported_languages": null}, "macro.fivetran_utils.default__union_data": {"name": "default__union_data", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_data.sql", "original_file_path": "macros/union_data.sql", "unique_id": "macro.fivetran_utils.default__union_data", "macro_sql": "{%- macro default__union_data(\n table_identifier, \n database_variable, \n schema_variable, \n default_database, \n default_schema, \n default_variable,\n union_schema_variable,\n union_database_variable\n ) -%}\n\n{%- if var(union_schema_variable, none) -%}\n\n {%- set relations = [] -%}\n \n {%- if var(union_schema_variable) is string -%}\n {%- set trimmed = var(union_schema_variable)|trim('[')|trim(']') -%}\n {%- set schemas = trimmed.split(',')|map('trim',\" \")|map('trim','\"')|map('trim',\"'\") -%}\n {%- else -%}\n {%- set schemas = var(union_schema_variable) -%}\n {%- endif -%}\n\n {%- for schema in var(union_schema_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else var(database_variable, default_database),\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else schema,\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n \n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n \n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- elif var(union_database_variable, none) -%}\n\n {%- set relations = [] -%}\n\n {%- for database in var(union_database_variable) -%}\n {%- set relation=adapter.get_relation(\n database=source(schema, table_identifier).database if var('has_defined_sources', false) else database,\n schema=source(schema, table_identifier).schema if var('has_defined_sources', false) else var(schema_variable, default_schema),\n identifier=source(schema, table_identifier).identifier if var('has_defined_sources', false) else table_identifier\n ) -%}\n\n {%- set relation_exists=relation is not none -%}\n\n {%- if relation_exists -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n {%- endfor -%}\n\n {%- if relations != [] -%}\n {{ dbt_utils.union_relations(relations) }}\n {%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n {%- endif -%}\n\n{%- else -%}\n {% set exception_schemas = {\"linkedin_company_pages\": \"linkedin_pages\", \"instagram_business_pages\": \"instagram_business\"} %}\n {% set relation = namespace(value=\"\") %}\n {% if default_schema in exception_schemas.keys() %}\n {% for corrected_schema_name in exception_schemas.items() %} \n {% if default_schema in corrected_schema_name %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = corrected_schema_name[1] + \"_\" + table_identifier + \"_identifier\" %}\n {%- set relation.value=adapter.get_relation(\n database=source(corrected_schema_name[1], table_identifier).database,\n schema=source(corrected_schema_name[1], table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n {% endfor %}\n {% else %}\n {# In order for this macro to effectively work within upstream integration tests (mainly used by the Fivetran dbt package maintainers), this identifier variable selection is required to use the macro with different identifier names. #}\n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifier\" %}\n {# Unfortunately the Twitter Organic identifiers were misspelled. As such, we will need to account for this in the model. This will be adjusted in the Twitter Organic package, but to ensure backwards compatibility, this needs to be included. #}\n {% if var(identifier_var, none) is none %} \n {% set identifier_var = default_schema + \"_\" + table_identifier + \"_identifer\" %}\n {% endif %}\n {%- set relation.value=adapter.get_relation(\n database=source(default_schema, table_identifier).database,\n schema=source(default_schema, table_identifier).schema,\n identifier=var(identifier_var, table_identifier)\n ) -%}\n {% endif %}\n{%- set table_exists=relation.value is not none -%}\n\n{%- if table_exists -%}\n select * \n from {{ relation.value }}\n{%- else -%}\n {% if execute and not var('fivetran__remove_empty_table_warnings', false) -%}\n {{ exceptions.warn(\"\\n\\nPlease be aware: The \" ~ table_identifier|upper ~ \" table was not found in your \" ~ default_schema|upper ~ \" schema(s). The Fivetran dbt package will create a completely empty \" ~ table_identifier|upper ~ \" staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_data-source for details).\\n\") }}\n {% endif -%}\n select \n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit 0\n{%- endif -%}\n{%- endif -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils.union_relations", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8743227, "supported_languages": null}, "macro.fivetran_utils.empty_variable_warning": {"name": "empty_variable_warning", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/empty_variable_warning.sql", "original_file_path": "macros/empty_variable_warning.sql", "unique_id": "macro.fivetran_utils.empty_variable_warning", "macro_sql": "{% macro empty_variable_warning(variable, downstream_model) %}\n\n{% if not var(variable) %}\n{{ log(\n \"\"\"\n Warning: You have passed an empty list to the \"\"\" ~ variable ~ \"\"\".\n As a result, you won't see the history of any columns in the \"\"\" ~ downstream_model ~ \"\"\" model.\n \"\"\",\n info=True\n) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8752003, "supported_languages": null}, "macro.fivetran_utils.string_agg": {"name": "string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.string_agg", "macro_sql": "{% macro string_agg(field_to_agg, delimiter) -%}\n\n{{ adapter.dispatch('string_agg', 'fivetran_utils') (field_to_agg, delimiter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__string_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.875878, "supported_languages": null}, "macro.fivetran_utils.default__string_agg": {"name": "default__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.default__string_agg", "macro_sql": "{% macro default__string_agg(field_to_agg, delimiter) %}\n string_agg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8761606, "supported_languages": null}, "macro.fivetran_utils.snowflake__string_agg": {"name": "snowflake__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.snowflake__string_agg", "macro_sql": "{% macro snowflake__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8764298, "supported_languages": null}, "macro.fivetran_utils.redshift__string_agg": {"name": "redshift__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.redshift__string_agg", "macro_sql": "{% macro redshift__string_agg(field_to_agg, delimiter) %}\n listagg({{ field_to_agg }}, {{ delimiter }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8766954, "supported_languages": null}, "macro.fivetran_utils.spark__string_agg": {"name": "spark__string_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/string_agg.sql", "original_file_path": "macros/string_agg.sql", "unique_id": "macro.fivetran_utils.spark__string_agg", "macro_sql": "{% macro spark__string_agg(field_to_agg, delimiter) %}\n -- collect set will remove duplicates\n replace(replace(replace(cast( collect_set({{ field_to_agg }}) as string), '[', ''), ']', ''), ', ', {{ delimiter }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8769946, "supported_languages": null}, "macro.fivetran_utils.array_agg": {"name": "array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.array_agg", "macro_sql": "{% macro array_agg(field_to_agg) -%}\n\n{{ adapter.dispatch('array_agg', 'fivetran_utils') (field_to_agg) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__array_agg"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8774815, "supported_languages": null}, "macro.fivetran_utils.default__array_agg": {"name": "default__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.default__array_agg", "macro_sql": "{% macro default__array_agg(field_to_agg) %}\n array_agg({{ field_to_agg }})\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8776977, "supported_languages": null}, "macro.fivetran_utils.redshift__array_agg": {"name": "redshift__array_agg", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/array_agg.sql", "original_file_path": "macros/array_agg.sql", "unique_id": "macro.fivetran_utils.redshift__array_agg", "macro_sql": "{% macro redshift__array_agg(field_to_agg) %}\n listagg({{ field_to_agg }}, ',')\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.877931, "supported_languages": null}, "macro.fivetran_utils.extract_url_parameter": {"name": "extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.extract_url_parameter", "macro_sql": "{% macro extract_url_parameter(field, url_parameter) -%}\n\n{{ adapter.dispatch('extract_url_parameter', 'fivetran_utils') (field, url_parameter) }}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__extract_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8785148, "supported_languages": null}, "macro.fivetran_utils.default__extract_url_parameter": {"name": "default__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.default__extract_url_parameter", "macro_sql": "{% macro default__extract_url_parameter(field, url_parameter) -%}\n\n{{ dbt_utils.get_url_parameter(field, url_parameter) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.get_url_parameter"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8788104, "supported_languages": null}, "macro.fivetran_utils.spark__extract_url_parameter": {"name": "spark__extract_url_parameter", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/extract_url_parameter.sql", "original_file_path": "macros/extract_url_parameter.sql", "unique_id": "macro.fivetran_utils.spark__extract_url_parameter", "macro_sql": "{% macro spark__extract_url_parameter(field, url_parameter) -%}\n\n{%- set formatted_url_parameter = \"'\" + url_parameter + \"=([^&]+)'\" -%}\nnullif(regexp_extract({{ field }}, {{ formatted_url_parameter }}, 1), '')\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.879222, "supported_languages": null}, "macro.fivetran_utils.fivetran_date_spine": {"name": "fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.fivetran_date_spine", "macro_sql": "{% macro fivetran_date_spine(datepart, start_date, end_date) -%}\n\n{{ return(adapter.dispatch('fivetran_date_spine', 'fivetran_utils') (datepart, start_date, end_date)) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__fivetran_date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8801897, "supported_languages": null}, "macro.fivetran_utils.default__fivetran_date_spine": {"name": "default__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.default__fivetran_date_spine", "macro_sql": "{% macro default__fivetran_date_spine(datepart, start_date, end_date) %}\n\n {{ dbt_utils.date_spine(datepart, start_date, end_date) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt_utils.date_spine"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.880542, "supported_languages": null}, "macro.fivetran_utils.sqlserver__fivetran_date_spine": {"name": "sqlserver__fivetran_date_spine", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fivetran_date_spine.sql", "original_file_path": "macros/fivetran_date_spine.sql", "unique_id": "macro.fivetran_utils.sqlserver__fivetran_date_spine", "macro_sql": "{% macro sqlserver__fivetran_date_spine(datepart, start_date, end_date) -%}\n\n {% set date_spine_query %}\n with\n\n l0 as (\n\n select c\n from (select 1 union all select 1) as d(c)\n\n ),\n l1 as (\n\n select\n 1 as c\n from l0 as a\n cross join l0 as b\n\n ),\n\n l2 as (\n\n select 1 as c\n from l1 as a\n cross join l1 as b\n ),\n\n l3 as (\n\n select 1 as c\n from l2 as a\n cross join l2 as b\n ),\n\n l4 as (\n\n select 1 as c\n from l3 as a\n cross join l3 as b\n ),\n\n l5 as (\n\n select 1 as c\n from l4 as a\n cross join l4 as b\n ),\n\n nums as (\n\n select row_number() over (order by (select null)) as rownum\n from l5\n ),\n\n rawdata as (\n\n select top ({{dbt.datediff(start_date, end_date, datepart)}}) rownum -1 as n\n from nums\n order by rownum\n ),\n\n all_periods as (\n\n select (\n {{\n dbt.dateadd(\n datepart,\n 'n',\n start_date\n )\n }}\n ) as date_{{datepart}}\n from rawdata\n ),\n\n filtered as (\n\n select *\n from all_periods\n where date_{{datepart}} <= {{ end_date }}\n\n )\n\n select * from filtered\n order by 1\n\n {% endset %}\n\n {% set results = run_query(date_spine_query) %}\n\n {% if execute %}\n\n {% set results_list = results.columns[0].values() %}\n \n {% else %}\n\n {% set results_list = [] %}\n\n {% endif %}\n\n {%- for date_field in results_list %}\n select cast('{{ date_field }}' as date) as date_{{datepart}} {{ 'union all ' if not loop.last else '' }}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff", "macro.dbt.dateadd", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8822815, "supported_languages": null}, "macro.fivetran_utils.add_dbt_source_relation": {"name": "add_dbt_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_dbt_source_relation.sql", "original_file_path": "macros/add_dbt_source_relation.sql", "unique_id": "macro.fivetran_utils.add_dbt_source_relation", "macro_sql": "{% macro add_dbt_source_relation() %}\n\n{% if var('union_schemas', none) or var('union_databases', none) %}\n, _dbt_source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.882812, "supported_languages": null}, "macro.fivetran_utils.percentile": {"name": "percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.percentile", "macro_sql": "{% macro percentile(percentile_field, partition_field, percent) -%}\n\n{{ adapter.dispatch('percentile', 'fivetran_utils') (percentile_field, partition_field, percent) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__percentile"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8836412, "supported_languages": null}, "macro.fivetran_utils.default__percentile": {"name": "default__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.default__percentile", "macro_sql": "{% macro default__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8840067, "supported_languages": null}, "macro.fivetran_utils.redshift__percentile": {"name": "redshift__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.redshift__percentile", "macro_sql": "{% macro redshift__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n over ( partition by {{ partition_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8843372, "supported_languages": null}, "macro.fivetran_utils.bigquery__percentile": {"name": "bigquery__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.bigquery__percentile", "macro_sql": "{% macro bigquery__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8846653, "supported_languages": null}, "macro.fivetran_utils.postgres__percentile": {"name": "postgres__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.postgres__percentile", "macro_sql": "{% macro postgres__percentile(percentile_field, partition_field, percent) %}\n\n percentile_cont( \n {{ percent }} )\n within group ( order by {{ percentile_field }} )\n /* have to group by partition field */\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8849864, "supported_languages": null}, "macro.fivetran_utils.spark__percentile": {"name": "spark__percentile", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/percentile.sql", "original_file_path": "macros/percentile.sql", "unique_id": "macro.fivetran_utils.spark__percentile", "macro_sql": "{% macro spark__percentile(percentile_field, partition_field, percent) %}\n\n percentile( \n {{ percentile_field }}, \n {{ percent }}) \n over (partition by {{ partition_field }} \n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8853166, "supported_languages": null}, "macro.fivetran_utils.union_relations_custom": {"name": "union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.union_relations_custom", "macro_sql": "{%- macro union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n {{ return(adapter.dispatch('union_relations_custom', 'fivetran_utils')(relations, aliases, column_override, include, exclude, source_column_name, where)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_relations_custom"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.887413, "supported_languages": null}, "macro.fivetran_utils.default__union_relations_custom": {"name": "default__union_relations_custom", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_relations_custom.sql", "original_file_path": "macros/union_relations_custom.sql", "unique_id": "macro.fivetran_utils.default__union_relations_custom", "macro_sql": "\n\n{%- macro default__union_relations_custom(relations, aliases=none, column_override=none, include=[], exclude=[], source_column_name='_dbt_source_relation', where=none) -%}\n\n {%- if exclude and include -%}\n {{ exceptions.raise_compiler_error(\"Both an exclude and include list were provided to the `union` macro. Only one is allowed\") }}\n {%- endif -%}\n\n {#-- Prevent querying of db in parsing mode. This works because this macro does not create any new refs. -#}\n {%- if not execute %}\n {{ return('') }}\n {% endif -%}\n\n {%- set column_override = column_override if column_override is not none else {} -%}\n\n {%- set relation_columns = {} -%}\n {%- set column_superset = {} -%}\n {%- set all_excludes = [] -%}\n {%- set all_includes = [] -%}\n\n {%- if exclude -%}\n {%- for exc in exclude -%}\n {%- do all_excludes.append(exc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- if include -%}\n {%- for inc in include -%}\n {%- do all_includes.append(inc | lower) -%}\n {%- endfor -%}\n {%- endif -%}\n\n {%- for relation in relations -%}\n\n {%- do relation_columns.update({relation: []}) -%}\n\n {%- do dbt_utils._is_relation(relation, 'union_relations_custom') -%}\n {%- do dbt_utils._is_ephemeral(relation, 'union_relations_custom') -%}\n {%- set cols = adapter.get_columns_in_relation(relation) -%}\n {%- for col in cols -%}\n\n {#- If an exclude list was provided and the column is in the list, do nothing -#}\n {%- if exclude and col.column | lower in all_excludes -%}\n\n {#- If an include list was provided and the column is not in the list, do nothing -#}\n {%- elif include and col.column | lower not in all_includes -%}\n\n {#- Otherwise add the column to the column superset -#}\n {%- else -%}\n\n {#- update the list of columns in this relation -#}\n {%- do relation_columns[relation].append(col.column) -%}\n\n {%- if col.column in column_superset -%}\n\n {%- set stored = column_superset[col.column] -%}\n {%- if col.is_string() and stored.is_string() and col.string_size() > stored.string_size() -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif %}\n\n {%- else -%}\n\n {%- do column_superset.update({col.column: col}) -%}\n\n {%- endif -%}\n\n {%- endif -%}\n\n {%- endfor -%}\n {%- endfor -%}\n\n {%- set ordered_column_names = column_superset.keys() -%}\n {%- set dbt_command = flags.WHICH -%}\n\n\n {% if dbt_command in ['run', 'build'] %}\n {% if (include | length > 0 or exclude | length > 0) and not column_superset.keys() %}\n {%- set relations_string -%}\n {%- for relation in relations -%}\n {{ relation.name }}\n {%- if not loop.last %}, {% endif -%}\n {%- endfor -%}\n {%- endset -%}\n\n {%- set error_message -%}\n There were no columns found to union for relations {{ relations_string }}\n {%- endset -%}\n\n {{ exceptions.raise_compiler_error(error_message) }}\n {%- endif -%}\n {%- endif -%}\n\n {%- for relation in relations %}\n\n (\n select\n\n {%- if source_column_name is not none %}\n {# dbt_utils union_relations includes the table in the source_relation. For Fivetran dbt package purposes the table should not be included in the source relation. #}\n cast({{ dbt.string_literal(relation.database ~ '.' ~ relation.schema) }} as {{ dbt.type_string() }}) as {{ source_column_name }},\n {%- endif %}\n\n {% for col_name in ordered_column_names -%}\n\n {%- set col = column_superset[col_name] %}\n {%- set col_type = column_override.get(col.column, col.data_type) %}\n {%- set col_name = adapter.quote(col_name) if col_name in relation_columns[relation] else 'null' %}\n cast({{ col_name }} as {{ col_type }}) as {{ col.quoted }} {% if not loop.last %},{% endif -%}\n\n {%- endfor %}\n \n {# This alias is a change from dbt_utils union_relations code. Avoids errors if the table is named a reserved keyword #}\n from {{ aliases[loop.index0] if aliases else relation }} as unioned_relation_{{ loop.index }}\n\n {% if where -%}\n where {{ where }}\n {%- endif %}\n )\n\n {% if not loop.last -%}\n union all\n {% endif -%}\n\n {%- endfor -%}\n\n{%- endmacro -%}", "depends_on": {"macros": ["macro.dbt_utils._is_relation", "macro.dbt_utils._is_ephemeral", "macro.dbt.string_literal", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8945436, "supported_languages": null}, "macro.fivetran_utils.apply_source_relation": {"name": "apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.apply_source_relation", "macro_sql": "{% macro apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{{ adapter.dispatch('apply_source_relation', 'fivetran_utils') (package_name, use_package_prefix) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__apply_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8954458, "supported_languages": null}, "macro.fivetran_utils.default__apply_source_relation": {"name": "default__apply_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/apply_source_relation.sql", "original_file_path": "macros/apply_source_relation.sql", "unique_id": "macro.fivetran_utils.default__apply_source_relation", "macro_sql": "{% macro default__apply_source_relation(package_name, use_package_prefix=true) -%}\n\n{% set sources_var = package_name ~ '_sources' %}\n{% set database_var = package_name ~ '_database' %}\n{% set schema_var = package_name ~ '_schema' %}\n\n{% if use_package_prefix %}\n {% set union_schemas_var = package_name ~ '_union_schemas' %}\n {% set union_databases_var = package_name ~ '_union_databases' %}\n{% else %}\n {% set union_schemas_var = 'union_schemas' %}\n {% set union_databases_var = 'union_databases' %}\n{% endif %}\n\n{% if var(sources_var, []) | length > 0 %}\n, _dbt_source_relation as source_relation\n{% elif var(union_schemas_var, []) | length > 0 or var(union_databases_var, []) | length > 0 %}\n{{ fivetran_utils.source_relation(union_schema_variable=union_schemas_var, union_database_variable=union_databases_var) }}\n{% else %}\n{% set database = var(database_var, target.database) %}\n{% set schema = var(schema_var, package_name) %}\n, cast('{{ database ~ \".\" ~ schema }}' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.source_relation", "macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8976858, "supported_languages": null}, "macro.fivetran_utils.source_relation": {"name": "source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.source_relation", "macro_sql": "{% macro source_relation(union_schema_variable='union_schemas', union_database_variable='union_databases') -%}\n\n{{ adapter.dispatch('source_relation', 'fivetran_utils') (union_schema_variable, union_database_variable) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8984663, "supported_languages": null}, "macro.fivetran_utils.default__source_relation": {"name": "default__source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/source_relation.sql", "original_file_path": "macros/source_relation.sql", "unique_id": "macro.fivetran_utils.default__source_relation", "macro_sql": "{% macro default__source_relation(union_schema_variable, union_database_variable) %}\n\n{% if var(union_schema_variable, none) %}\n, case\n {% for schema in var(union_schema_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%.{{ schema|lower }}.%' then '{{ schema|lower }}'\n {% endfor %}\n end as source_relation\n{% elif var(union_database_variable, none) %}\n, case\n {% for database in var(union_database_variable) %}\n when lower(replace(replace(_dbt_source_relation,'\"',''),'`','')) like '%{{ database|lower }}.%' then '{{ database|lower }}'\n {% endfor %}\n end as source_relation\n{% else %}\n, cast('' as {{ dbt.type_string() }}) as source_relation\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.8996255, "supported_languages": null}, "macro.fivetran_utils.fill_staging_columns": {"name": "fill_staging_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.fill_staging_columns", "macro_sql": "{% macro fill_staging_columns(source_columns, staging_columns) %}\n\n{%- set source_column_names = source_columns|map(attribute='name')|map('lower')|list -%}\n{%- set using_source_casing = var('fivetran_using_source_casing', false) -%}\n\n{%- for column in staging_columns %}\n {%- if column.name|lower in source_column_names %}\n {%- if using_source_casing %}\n {%- set column_alias = column.alias if 'alias' in column else column.name %}\n {{ adapter.quote(column.name) }} as {{ adapter.quote(column_alias|upper if target.type == 'snowflake' else column_alias) }}\n {%- else %}\n {{ fivetran_utils.quote_column(column) }} as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}\n {%- else %}\n cast(null as {{ column.datatype }}) as\n {%- if 'alias' in column %} {{ column.alias }}{% else %} {{ fivetran_utils.quote_column(column) }}{% endif %}\n {%- endif %}{{ ',' if not loop.last }}\n{%- endfor %}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.quote_column"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9026408, "supported_languages": null}, "macro.fivetran_utils.quote_column": {"name": "quote_column", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_staging_columns.sql", "original_file_path": "macros/fill_staging_columns.sql", "unique_id": "macro.fivetran_utils.quote_column", "macro_sql": "{% macro quote_column(column) %}\n {%- if 'quote' in column %}\n {%- if column.quote %}\n {%- if target.type in ('bigquery', 'spark', 'databricks') %}\n `{{ column.name }}`\n {%- elif target.type == 'snowflake' %}\n \"{{ column.name | upper }}\"\n {%- else %}\n \"{{ column.name }}\"\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n {%- else %}{{ column.name }}\n {%- endif %}\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9037209, "supported_languages": null}, "macro.fivetran_utils.first_value": {"name": "first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.first_value", "macro_sql": "{% macro first_value(first_value_field, partition_field, order_by_field, order=\"asc\") -%}\n\n{{ adapter.dispatch('first_value', 'fivetran_utils') (first_value_field, partition_field, order_by_field, order) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__first_value"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9045184, "supported_languages": null}, "macro.fivetran_utils.default__first_value": {"name": "default__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.default__first_value", "macro_sql": "{% macro default__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.904966, "supported_languages": null}, "macro.fivetran_utils.redshift__first_value": {"name": "redshift__first_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/first_value.sql", "original_file_path": "macros/first_value.sql", "unique_id": "macro.fivetran_utils.redshift__first_value", "macro_sql": "{% macro redshift__first_value(first_value_field, partition_field, order_by_field, order=\"asc\") %}\n\n first_value( {{ first_value_field }} ignore nulls ) over (partition by {{ partition_field }} order by {{ order_by_field }} {{ order }} , {{ partition_field }} rows unbounded preceding )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.905428, "supported_languages": null}, "macro.fivetran_utils.ceiling": {"name": "ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.ceiling", "macro_sql": "{% macro ceiling(num) -%}\n\n{{ adapter.dispatch('ceiling', 'fivetran_utils') (num) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__ceiling"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9059358, "supported_languages": null}, "macro.fivetran_utils.default__ceiling": {"name": "default__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.default__ceiling", "macro_sql": "{% macro default__ceiling(num) %}\n ceiling({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9061542, "supported_languages": null}, "macro.fivetran_utils.snowflake__ceiling": {"name": "snowflake__ceiling", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/ceiling.sql", "original_file_path": "macros/ceiling.sql", "unique_id": "macro.fivetran_utils.snowflake__ceiling", "macro_sql": "{% macro snowflake__ceiling(num) %}\n ceil({{ num }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9063656, "supported_languages": null}, "macro.fivetran_utils.json_parse": {"name": "json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.json_parse", "macro_sql": "{% macro json_parse(string, string_path) -%}\n\n{{ adapter.dispatch('json_parse', 'fivetran_utils') (string, string_path) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__json_parse"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9075003, "supported_languages": null}, "macro.fivetran_utils.default__json_parse": {"name": "default__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.default__json_parse", "macro_sql": "{% macro default__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9080355, "supported_languages": null}, "macro.fivetran_utils.redshift__json_parse": {"name": "redshift__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.redshift__json_parse", "macro_sql": "{% macro redshift__json_parse(string, string_path) %}\n\n json_extract_path_text({{string}}, {%- for s in string_path -%}'{{ s }}'{%- if not loop.last -%},{%- endif -%}{%- endfor -%} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.908654, "supported_languages": null}, "macro.fivetran_utils.bigquery__json_parse": {"name": "bigquery__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.bigquery__json_parse", "macro_sql": "{% macro bigquery__json_parse(string, string_path) %}\n\n \n json_extract_scalar({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.909185, "supported_languages": null}, "macro.fivetran_utils.postgres__json_parse": {"name": "postgres__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.postgres__json_parse", "macro_sql": "{% macro postgres__json_parse(string, string_path) %}\n\n {{string}}::json #>> '{ {%- for s in string_path -%}{{ s }}{%- if not loop.last -%},{%- endif -%}{%- endfor -%} }'\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9096842, "supported_languages": null}, "macro.fivetran_utils.snowflake__json_parse": {"name": "snowflake__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.snowflake__json_parse", "macro_sql": "{% macro snowflake__json_parse(string, string_path) %}\n\n parse_json( {{string}} ) {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9102552, "supported_languages": null}, "macro.fivetran_utils.spark__json_parse": {"name": "spark__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.spark__json_parse", "macro_sql": "{% macro spark__json_parse(string, string_path) %}\n\n {{string}} : {%- for s in string_path -%}{% if s is number %}[{{ s }}]{% else %}['{{ s }}']{% endif %}{%- endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9107845, "supported_languages": null}, "macro.fivetran_utils.sqlserver__json_parse": {"name": "sqlserver__json_parse", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/json_parse.sql", "original_file_path": "macros/json_parse.sql", "unique_id": "macro.fivetran_utils.sqlserver__json_parse", "macro_sql": "{% macro sqlserver__json_parse(string, string_path) %}\n\n json_value({{string}}, '$.{%- for s in string_path -%}{{ s }}{%- if not loop.last -%}.{%- endif -%}{%- endfor -%} ')\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9112926, "supported_languages": null}, "macro.fivetran_utils.dummy_coalesce_value": {"name": "dummy_coalesce_value", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/dummy_coalesce_value.sql", "original_file_path": "macros/dummy_coalesce_value.sql", "unique_id": "macro.fivetran_utils.dummy_coalesce_value", "macro_sql": "{% macro dummy_coalesce_value(column) %}\n\n{% set coalesce_value = {\n 'STRING': \"'DUMMY_STRING'\",\n 'BOOLEAN': 'null',\n 'INT': 999999999,\n 'FLOAT': 999999999.99,\n 'TIMESTAMP': 'cast(\"2099-12-31\" as timestamp)',\n 'DATE': 'cast(\"2099-12-31\" as date)',\n} %}\n\n{% if column.is_float() %}\n{{ return(coalesce_value['FLOAT']) }}\n\n{% elif column.is_numeric() %}\n{{ return(coalesce_value['INT']) }}\n\n{% elif column.is_string() %}\n{{ return(coalesce_value['STRING']) }}\n\n{% elif column.data_type|lower == 'boolean' %}\n{{ return(coalesce_value['BOOLEAN']) }}\n\n{% elif 'timestamp' in column.data_type|lower %}\n{{ return(coalesce_value['TIMESTAMP']) }}\n\n{% elif 'date' in column.data_type|lower %}\n{{ return(coalesce_value['DATE']) }}\n\n{% elif 'int' in column.data_type|lower %}\n{{ return(coalesce_value['INT']) }}\n\n{% endif %}\n\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9138913, "supported_languages": null}, "macro.fivetran_utils.wrap_in_quotes": {"name": "wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.wrap_in_quotes", "macro_sql": "{%- macro wrap_in_quotes(object_to_quote) -%}\n\n{{ return(adapter.dispatch('wrap_in_quotes', 'fivetran_utils')(object_to_quote)) }}\n\n{%- endmacro -%}\n\n", "depends_on": {"macros": ["macro.fivetran_utils.postgres__wrap_in_quotes"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9145222, "supported_languages": null}, "macro.fivetran_utils.default__wrap_in_quotes": {"name": "default__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.default__wrap_in_quotes", "macro_sql": "{%- macro default__wrap_in_quotes(object_to_quote) -%}\n{# bigquery, spark, databricks #}\n `{{ object_to_quote }}`\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9147549, "supported_languages": null}, "macro.fivetran_utils.snowflake__wrap_in_quotes": {"name": "snowflake__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.snowflake__wrap_in_quotes", "macro_sql": "{%- macro snowflake__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote | upper }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9150145, "supported_languages": null}, "macro.fivetran_utils.redshift__wrap_in_quotes": {"name": "redshift__wrap_in_quotes", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/wrap_in_quotes.sql", "original_file_path": "macros/wrap_in_quotes.sql", "unique_id": "macro.fivetran_utils.redshift__wrap_in_quotes", "macro_sql": "{%- macro redshift__wrap_in_quotes(object_to_quote) -%}\n \"{{ object_to_quote }}\"\n{%- endmacro -%}\n\n", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9152274, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9154427, "supported_languages": null}, "macro.fivetran_utils.add_pass_through_columns": {"name": "add_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/add_pass_through_columns.sql", "original_file_path": "macros/add_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.add_pass_through_columns", "macro_sql": "{% macro add_pass_through_columns(base_columns, pass_through_var) %}\n\n {% if pass_through_var %}\n\n {% for column in pass_through_var %}\n\n {% if column is mapping %}\n\n {% if column.alias %}\n\n {% do base_columns.append({ \"name\": column.name, \"alias\": column.alias, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column.name, \"datatype\": column.datatype if column.datatype else dbt.type_string()}) %}\n \n {% endif %}\n\n {% else %}\n\n {% do base_columns.append({ \"name\": column, \"datatype\": dbt.type_string()}) %}\n\n {% endif %}\n\n {% endfor %}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.type_string"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.917394, "supported_languages": null}, "macro.fivetran_utils.timestamp_diff": {"name": "timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.timestamp_diff", "macro_sql": "{% macro timestamp_diff(first_date, second_date, datepart) %}\n {{ adapter.dispatch('timestamp_diff', 'fivetran_utils')(first_date, second_date, datepart) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_diff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9187691, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_diff": {"name": "default__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.default__timestamp_diff", "macro_sql": "{% macro default__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9191282, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_diff": {"name": "redshift__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_diff", "macro_sql": "{% macro redshift__timestamp_diff(first_date, second_date, datepart) %}\n\n datediff(\n {{ datepart }},\n {{ first_date }},\n {{ second_date }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9194589, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_diff": {"name": "bigquery__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_diff", "macro_sql": "{% macro bigquery__timestamp_diff(first_date, second_date, datepart) %}\n\n timestamp_diff(\n {{second_date}},\n {{first_date}},\n {{datepart}}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9197795, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_diff": {"name": "postgres__timestamp_diff", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_diff.sql", "original_file_path": "macros/timestamp_diff.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_diff", "macro_sql": "{% macro postgres__timestamp_diff(first_date, second_date, datepart) %}\n\n {% if datepart == 'year' %}\n (date_part('year', ({{second_date}})::date) - date_part('year', ({{first_date}})::date))\n {% elif datepart == 'quarter' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 4 + date_part('quarter', ({{second_date}})::date) - date_part('quarter', ({{first_date}})::date))\n {% elif datepart == 'month' %}\n ({{ dbt.datediff(first_date, second_date, 'year') }} * 12 + date_part('month', ({{second_date}})::date) - date_part('month', ({{first_date}})::date))\n {% elif datepart == 'day' %}\n (({{second_date}})::date - ({{first_date}})::date)\n {% elif datepart == 'week' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} / 7 + case\n when date_part('dow', ({{first_date}})::timestamp) <= date_part('dow', ({{second_date}})::timestamp) then\n case when {{first_date}} <= {{second_date}} then 0 else -1 end\n else\n case when {{first_date}} <= {{second_date}} then 1 else 0 end\n end)\n {% elif datepart == 'hour' %}\n ({{ dbt.datediff(first_date, second_date, 'day') }} * 24 + date_part('hour', ({{second_date}})::timestamp) - date_part('hour', ({{first_date}})::timestamp))\n {% elif datepart == 'minute' %}\n ({{ dbt.datediff(first_date, second_date, 'hour') }} * 60 + date_part('minute', ({{second_date}})::timestamp) - date_part('minute', ({{first_date}})::timestamp))\n {% elif datepart == 'second' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60 + floor(date_part('second', ({{second_date}})::timestamp)) - floor(date_part('second', ({{first_date}})::timestamp)))\n {% elif datepart == 'millisecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000 + floor(date_part('millisecond', ({{second_date}})::timestamp)) - floor(date_part('millisecond', ({{first_date}})::timestamp)))\n {% elif datepart == 'microsecond' %}\n ({{ dbt.datediff(first_date, second_date, 'minute') }} * 60000000 + floor(date_part('microsecond', ({{second_date}})::timestamp)) - floor(date_part('microsecond', ({{first_date}})::timestamp)))\n {% else %}\n {{ exceptions.raise_compiler_error(\"Unsupported datepart for macro datediff in postgres: {!r}\".format(datepart)) }}\n {% endif %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.datediff"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.923419, "supported_languages": null}, "macro.fivetran_utils.max_bool": {"name": "max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.max_bool", "macro_sql": "{% macro max_bool(boolean_field) -%}\n\n{{ adapter.dispatch('max_bool', 'fivetran_utils') (boolean_field) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__max_bool"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9240088, "supported_languages": null}, "macro.fivetran_utils.default__max_bool": {"name": "default__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.default__max_bool", "macro_sql": "{% macro default__max_bool(boolean_field) %}\n\n bool_or( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9242363, "supported_languages": null}, "macro.fivetran_utils.snowflake__max_bool": {"name": "snowflake__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.snowflake__max_bool", "macro_sql": "{% macro snowflake__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9244497, "supported_languages": null}, "macro.fivetran_utils.bigquery__max_bool": {"name": "bigquery__max_bool", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/max_bool.sql", "original_file_path": "macros/max_bool.sql", "unique_id": "macro.fivetran_utils.bigquery__max_bool", "macro_sql": "{% macro bigquery__max_bool(boolean_field) %}\n\n max( {{ boolean_field }} )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9246633, "supported_languages": null}, "macro.fivetran_utils.fill_pass_through_columns": {"name": "fill_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/fill_pass_through_columns.sql", "original_file_path": "macros/fill_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.fill_pass_through_columns", "macro_sql": "{% macro fill_pass_through_columns(pass_through_variable) %}\n\n{% if var(pass_through_variable) %}\n {% for field in var(pass_through_variable) %}\n {% if field is mapping %}\n {% if field.transform_sql %}\n , {{ field.transform_sql }} as {{ field.alias if field.alias else field.name }}\n {% else %}\n , {{ field.alias if field.alias else field.name }}\n {% endif %}\n {% else %}\n , {{ field }}\n {% endif %}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9260428, "supported_languages": null}, "macro.fivetran_utils.seed_data_helper": {"name": "seed_data_helper", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/seed_data_helper.sql", "original_file_path": "macros/seed_data_helper.sql", "unique_id": "macro.fivetran_utils.seed_data_helper", "macro_sql": "{% macro seed_data_helper(seed_name, warehouses) %}\n\n{% if target.type in warehouses %}\n {% for w in warehouses %}\n {% if target.type == w %}\n {{ return(ref(seed_name ~ \"_\" ~ w ~ \"\")) }}\n {% endif %}\n {% endfor %}\n{% else %}\n{{ return(ref(seed_name)) }}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9271624, "supported_languages": null}, "macro.fivetran_utils.remove_prefix_from_columns": {"name": "remove_prefix_from_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/remove_prefix_from_columns.sql", "original_file_path": "macros/remove_prefix_from_columns.sql", "unique_id": "macro.fivetran_utils.remove_prefix_from_columns", "macro_sql": "{% macro remove_prefix_from_columns(columns, prefix='', exclude=[]) %}\n\n {%- for col in columns if col.name not in exclude -%}\n {%- if col.name[:prefix|length]|lower == prefix -%}\n {{ col.name }} as {{ col.name[prefix|length:] }}\n {%- else -%}\n {{ col.name }}\n {%- endif -%}\n {%- if not loop.last -%},{%- endif %}\n {% endfor -%}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.92835, "supported_languages": null}, "macro.fivetran_utils.timestamp_add": {"name": "timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.timestamp_add", "macro_sql": "{% macro timestamp_add(datepart, interval, from_timestamp) -%}\n\n{{ adapter.dispatch('timestamp_add', 'fivetran_utils') (datepart, interval, from_timestamp) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.postgres__timestamp_add"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9291458, "supported_languages": null}, "macro.fivetran_utils.default__timestamp_add": {"name": "default__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.default__timestamp_add", "macro_sql": "{% macro default__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestampadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9294896, "supported_languages": null}, "macro.fivetran_utils.bigquery__timestamp_add": {"name": "bigquery__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.bigquery__timestamp_add", "macro_sql": "{% macro bigquery__timestamp_add(datepart, interval, from_timestamp) %}\n\n timestamp_add({{ from_timestamp }}, interval {{ interval }} {{ datepart }})\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9298174, "supported_languages": null}, "macro.fivetran_utils.redshift__timestamp_add": {"name": "redshift__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.redshift__timestamp_add", "macro_sql": "{% macro redshift__timestamp_add(datepart, interval, from_timestamp) %}\n\n dateadd(\n {{ datepart }},\n {{ interval }},\n {{ from_timestamp }}\n )\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.93017, "supported_languages": null}, "macro.fivetran_utils.postgres__timestamp_add": {"name": "postgres__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.postgres__timestamp_add", "macro_sql": "{% macro postgres__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ from_timestamp }} + ((interval '1 {{ datepart }}') * ({{ interval }}))\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9304879, "supported_languages": null}, "macro.fivetran_utils.spark__timestamp_add": {"name": "spark__timestamp_add", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/timestamp_add.sql", "original_file_path": "macros/timestamp_add.sql", "unique_id": "macro.fivetran_utils.spark__timestamp_add", "macro_sql": "{% macro spark__timestamp_add(datepart, interval, from_timestamp) %}\n\n {{ dbt.dateadd(datepart, interval, from_timestamp) }}\n \n{% endmacro %}", "depends_on": {"macros": ["macro.dbt.dateadd"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9308505, "supported_languages": null}, "macro.fivetran_utils.enabled_vars_one_true": {"name": "enabled_vars_one_true", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/enabled_vars_one_true.sql", "original_file_path": "macros/enabled_vars_one_true.sql", "unique_id": "macro.fivetran_utils.enabled_vars_one_true", "macro_sql": "{% macro enabled_vars_one_true(vars) %}\n\n{% for v in vars %}\n \n {% if var(v, False) == True %}\n {{ return(True) }}\n {% endif %}\n\n{% endfor %}\n\n{{ return(False) }}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9316018, "supported_languages": null}, "macro.fivetran_utils.union_connections": {"name": "union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.union_connections", "macro_sql": "{% macro union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{{ adapter.dispatch('union_connections', 'fivetran_utils') (connection_dictionary, single_source_name, single_table_name, default_identifier) }}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__union_connections"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.933076, "supported_languages": null}, "macro.fivetran_utils.default__union_connections": {"name": "default__union_connections", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/union_connections.sql", "original_file_path": "macros/union_connections.sql", "unique_id": "macro.fivetran_utils.default__union_connections", "macro_sql": "{% macro default__union_connections(connection_dictionary, single_source_name, single_table_name, default_identifier=single_table_name) %}\n\n{%- set exception_warning = \"\\n\\nPlease be aware: The \" ~ single_source_name|upper ~ \".\" ~ single_table_name|upper ~ \" table was not found in your schema(s). The Fivetran Data Model will create a completely empty staging model as to not break downstream transformations. To turn off these warnings, set the `fivetran__remove_empty_table_warnings` variable to TRUE (see https://github.com/fivetran/dbt_fivetran_utils/tree/releases/v0.4.latest#union_connections-source for details).\\n\"%}\n{%- set using_empty_table_warnings = (execute and not var('fivetran__remove_empty_table_warnings', false)) %}\n{%- set connections = var(connection_dictionary, []) %}\n{%- set using_unioning = connections | length > 0 %}\n{%- set identifier_var = single_source_name + \"_\" + single_table_name + \"_identifier\" %}\n\n{%- if using_unioning %}\n{# For unioning #}\n {%- set relations = [] -%}\n {%- for connection in connections -%}\n\n {% if var('has_defined_sources', false) %}\n {%- set database = source(connection.name, single_table_name).database %}\n {%- set schema = source(connection.name, single_table_name).schema %}\n {%- set identifier = source(connection.name, single_table_name).identifier %}\n {%- else %}\n {%- set database = connection.database if connection.database else target.database %}\n {%- set schema = connection.schema if connection.schema else single_source_name %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n {%- endif %}\n \n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n {%- if relation is not none -%}\n {%- do relations.append(relation) -%}\n {%- endif -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- database: ' ~ database }}\n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {%- endfor -%}\n\n {%- if relations | length > 0 -%}\n {{ fivetran_utils.union_relations_custom(relations, source_column_name='_dbt_source_relation') }}\n\n {%- else -%}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n\n{% else %}\n{# Not unioning #}\n\n {%- set database = source(single_source_name, single_table_name).database %}\n {%- set schema = source(single_source_name, single_table_name).schema %}\n {%- set identifier = var(identifier_var, default_identifier) %}\n\n {%- set relation=adapter.get_relation(\n database=database,\n schema=schema,\n identifier=identifier\n )\n -%}\n\n -- ** Values passed to adapter.get_relation:\n {{ '-- full-identifier_var: ' ~ identifier_var }}\n {{ '-- database: ' ~ database }} \n {{ '-- schema: ' ~ schema }}\n {{ '-- identifier: ' ~ identifier ~ '\\n' }}\n\n {% if relation is not none -%}\n select\n {{ dbt_utils.star(from=source(single_source_name, single_table_name)) }}\n from {{ source(single_source_name, single_table_name) }} as source_table\n\n {% else %}\n {{ exceptions.warn(exception_warning) if using_empty_table_warnings }}\n\n select\n cast(null as {{ dbt.type_string() }}) as _dbt_source_relation\n limit {{ '0' if target.type != 'redshift' else '1' }}\n {%- endif -%}\n{% endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.union_relations_custom", "macro.dbt.type_string", "macro.dbt_utils.star"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9386535, "supported_languages": null}, "macro.fivetran_utils.partition_by_source_relation": {"name": "partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.partition_by_source_relation", "macro_sql": "{% macro partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) %}\n {{ return(adapter.dispatch('partition_by_source_relation', 'fivetran_utils')(package_name, has_other_partitions, alias, package_prefix_union_variable)) }}\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__partition_by_source_relation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9397025, "supported_languages": null}, "macro.fivetran_utils.default__partition_by_source_relation": {"name": "default__partition_by_source_relation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/partition_by_source_relation.sql", "original_file_path": "macros/partition_by_source_relation.sql", "unique_id": "macro.fivetran_utils.default__partition_by_source_relation", "macro_sql": "{% macro default__partition_by_source_relation(package_name, has_other_partitions='yes', alias=None, package_prefix_union_variable=true) -%}\n\n{%- if package_prefix_union_variable %}\n {%- set union_schemas_var = package_name ~ '_union_schemas' -%}\n {%- set union_databases_var = package_name ~ '_union_databases' -%}\n{%- else %}\n {%- set union_schemas_var = 'union_schemas' -%}\n {%- set union_databases_var = 'union_databases' -%}\n{%- endif -%}\n\n{%- set is_unioning = var(union_schemas_var, [])|length > 1 or var(union_databases_var, [])|length > 1 or var(package_name ~ '_sources', [])|length > 1 -%}\n{%- set prefix = '' if alias is none else alias ~ '.' -%}\n\n{%- if has_other_partitions == 'no' -%}\n {{- 'partition by ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- else -%}\n {{- ', ' ~ prefix ~ 'source_relation' if is_unioning else '' -}}\n{%- endif -%}\n\n{%- endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9414752, "supported_languages": null}, "macro.fivetran_utils.persist_pass_through_columns": {"name": "persist_pass_through_columns", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/persist_pass_through_columns.sql", "original_file_path": "macros/persist_pass_through_columns.sql", "unique_id": "macro.fivetran_utils.persist_pass_through_columns", "macro_sql": "{% macro persist_pass_through_columns(pass_through_variable, identifier=none, transform='') %}\n\n{% if var(pass_through_variable, none) %}\n {% for field in var(pass_through_variable) %}\n , {{ transform ~ '(' ~ (identifier ~ '.' if identifier else '') ~ (field.alias if field.alias else field.name) ~ ')' }} as {{ field.alias if field.alias else field.name }}\n {% endfor %}\n{% endif %}\n\n{% endmacro %}", "depends_on": {"macros": []}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.942716, "supported_languages": null}, "macro.fivetran_utils.drop_schemas_automation": {"name": "drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.drop_schemas_automation", "macro_sql": "{% macro drop_schemas_automation(drop_target_schema=true) %}\n {{ return(adapter.dispatch('drop_schemas_automation', 'fivetran_utils')(drop_target_schema)) }}\n{%- endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.default__drop_schemas_automation"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9435472, "supported_languages": null}, "macro.fivetran_utils.default__drop_schemas_automation": {"name": "default__drop_schemas_automation", "resource_type": "macro", "package_name": "fivetran_utils", "path": "macros/drop_schemas_automation.sql", "original_file_path": "macros/drop_schemas_automation.sql", "unique_id": "macro.fivetran_utils.default__drop_schemas_automation", "macro_sql": "{% macro default__drop_schemas_automation(drop_target_schema=true) %}\n\n{% set fetch_list_sql %}\n {% if target.type not in ('databricks', 'spark') %}\n select schema_name\n from \n {{ wrap_in_quotes(target.database) }}.INFORMATION_SCHEMA.SCHEMATA\n where lower(schema_name) like '{{ target.schema | lower }}{%- if not drop_target_schema -%}_{%- endif -%}%'\n {% else %}\n SHOW SCHEMAS LIKE '{{ target.schema }}{%- if not drop_target_schema -%}_{%- endif -%}*'\n {% endif %}\n{% endset %}\n\n{% set results = run_query(fetch_list_sql) %}\n\n{% if execute %}\n {% set results_list = results.columns[0].values() %}\n{% else %}\n {% set results_list = [] %}\n{% endif %}\n\n{% for schema_to_drop in results_list %}\n {% do adapter.drop_schema(api.Relation.create(database=target.database, schema=schema_to_drop)) %}\n {{ print('Schema ' ~ schema_to_drop ~ ' successfully dropped from the ' ~ target.database ~ ' database.\\n')}}\n{% endfor %}\n\n{% endmacro %}", "depends_on": {"macros": ["macro.fivetran_utils.wrap_in_quotes", "macro.dbt.run_query"]}, "description": "", "meta": {}, "docs": {"show": true, "node_color": null}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9454985, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9489284, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9502897, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.952025, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9539115, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9553194, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9570544, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9576504, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.958077, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9603245, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9609852, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9615064, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9620464, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9622953, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9624534, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9626718, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9664433, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9668183, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9737444, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9747527, "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}, "config": {"meta": {}, "docs": {"show": true, "node_color": null}}, "patch_path": null, "arguments": [], "created_at": 1784132713.9752364, "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.integrity_daily_activity": [{"database": "postgres", "schema": "public_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, "static_analysis": 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": 1784132714.8156192, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.integrity_campaign_performance": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "integrity_campaign_performance", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "integrity/integrity_campaign_performance.sql", "original_file_path": "tests/integrity/integrity_campaign_performance.sql", "unique_id": "test.salesforce_integration_tests.integrity_campaign_performance", "fqn": ["salesforce_integration_tests", "integrity", "integrity_campaign_performance"], "alias": "integrity_campaign_performance", "checksum": {"name": "sha256", "checksum": "770cc214c75cb0e6060c53dbc16a02a15c9fe4d79a9e1d7ca845cf00b13848e1"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "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": 1784132714.8524055, "relation_name": null, "raw_code": "{{ config(\n tags=\"fivetran_validations\",\n enabled=var('fivetran_validation_tests_enabled', false)\n) }}\n\n-- this test validates that the campaign_performance end model correctly reflects\n-- source data: row parity with stg_campaign, member_count from stg_campaign_member,\n-- and total_won_amount from stg_opportunity\n\nwith end_model as (\n select *\n from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance\n),\n\n-- verify 1:1 relationship with staging campaign -- no fanout, no missing rows\ncampaign_row_parity as (\n select count(*) as end_model_count\n from end_model\n),\n\nstg_campaign_count as (\n select count(*) as stg_count\n from {{ target.schema }}_salesforce_dev.stg_salesforce__campaign\n),\n\nrow_parity_check as (\n select *\n from campaign_row_parity\n join stg_campaign_count\n on end_model_count != stg_count\n),\n\n-- verify member_count matches direct count from stg_campaign_member\nmember_count_check as (\n select\n e.campaign_id,\n e.member_count as end_model_member_count,\n coalesce(m.stg_member_count, 0) as stg_member_count\n from end_model e\n left join (\n select\n campaign_id,\n count(*) as stg_member_count\n from {{ target.schema }}_salesforce_dev.stg_salesforce__campaign_member\n group by 1\n ) m\n on e.campaign_id = m.campaign_id\n where coalesce(e.member_count, 0) != coalesce(m.stg_member_count, 0)\n),\n\n-- verify total_won_amount matches direct sum from stg_opportunity\nwon_amount_check as (\n select\n e.campaign_id,\n e.total_won_amount as end_model_won_amount,\n o.stg_won_amount\n from end_model e\n left join (\n select\n campaign_id,\n sum(amount) as stg_won_amount\n from {{ target.schema }}_salesforce_dev.stg_salesforce__opportunity\n where is_won = true\n and campaign_id is not null\n group by 1\n ) o\n on e.campaign_id = o.campaign_id\n where coalesce(e.total_won_amount, 0) != coalesce(o.stg_won_amount, 0)\n),\n\nfinal as (\n select campaign_id, 'member_count mismatch' as reason from member_count_check\n union all\n select campaign_id, 'total_won_amount mismatch' as reason from won_amount_check\n union all\n select cast(null as string), 'campaign row count mismatch' as reason from row_parity_check\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_daily_activity_count": [{"database": "postgres", "schema": "public_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, "static_analysis": 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": 1784132714.859236, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "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": "public_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, "static_analysis": 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": 1784132714.8654907, "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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": ["macro.dbt.current_timestamp"], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_campaign_performance_count": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaign_performance_count", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_campaign_performance_count.sql", "original_file_path": "tests/consistency/consistency_campaign_performance_count.sql", "unique_id": "test.salesforce_integration_tests.consistency_campaign_performance_count", "fqn": ["salesforce_integration_tests", "consistency", "consistency_campaign_performance_count"], "alias": "consistency_campaign_performance_count", "checksum": {"name": "sha256", "checksum": "0804ad4afc7a3c25031d5f4f35e964c55aac27dfb6d1a478ba0fb8372fd966de"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "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": 1784132714.8743432, "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 row counts are the same between versions\nwith prod as (\n select count(*) as prod_rows\n from {{ target.schema }}_salesforce_prod.salesforce__campaign_performance\n),\n\ndev as (\n select count(*) as dev_rows\n from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_campaign_performance": [{"database": "postgres", "schema": "public_dbt_test__audit", "name": "consistency_campaign_performance", "resource_type": "test", "package_name": "salesforce_integration_tests", "path": "consistency/consistency_campaign_performance.sql", "original_file_path": "tests/consistency/consistency_campaign_performance.sql", "unique_id": "test.salesforce_integration_tests.consistency_campaign_performance", "fqn": ["salesforce_integration_tests", "consistency", "consistency_campaign_performance"], "alias": "consistency_campaign_performance", "checksum": {"name": "sha256", "checksum": "64018b6ca4dfc55807df5c30df1301d424f09edef2c30dcf8fbcb27c64890208"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "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": 1784132714.8813741, "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 campaign_performance end model matches the prior version\nwith prod as (\n select *\n from {{ target.schema }}_salesforce_prod.salesforce__campaign_performance\n),\n\ndev as (\n select *\n from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance\n),\n\nprod_not_in_dev as (\n -- rows from prod not found in dev\n select * from prod\n except distinct\n select * from dev\n),\n\ndev_not_in_prod as (\n -- rows from dev not found in prod\n select * from dev\n except distinct\n select * from prod\n),\n\nfinal as (\n select\n *,\n 'from prod' as source\n from prod_not_in_dev\n\n union all -- union since we only care if rows are produced\n\n select\n *,\n 'from dev' as source\n from dev_not_in_prod\n)\n\nselect *\nfrom final", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}], "test.salesforce_integration_tests.consistency_columns": [{"database": "postgres", "schema": "public_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": "6d72837a85c9cb0e8ad68bb612a6f0983717b120b35d705a1268104b03cdeec1"}, "config": {"enabled": false, "alias": null, "schema": "dbt_test__audit", "database": null, "tags": ["fivetran_validations"], "meta": {}, "group": null, "static_analysis": null, "materialized": "test", "severity": "ERROR", "store_failures": null, "store_failures_as": null, "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": 1784132714.8876603, "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!!! */\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", "doc_blocks": [], "language": "sql", "refs": [], "sources": [], "metrics": [], "functions": [], "depends_on": {"macros": [], "nodes": []}, "compiled_path": null, "contract": {"enforced": false, "alias_types": true, "checksum": null}}]}, "parent_map": {"seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_campaign_history_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_campaign_member_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_record_type_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "seed.salesforce_integration_tests.sf_campaign_data": [], "model.salesforce.salesforce__campaign_performance": ["model.salesforce.stg_salesforce__campaign", "model.salesforce.stg_salesforce__campaign_member", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__record_type"], "model.salesforce.salesforce__daily_activity": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.stg_salesforce__event", "model.salesforce.stg_salesforce__lead", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__task"], "model.salesforce.salesforce__contact_enhanced": ["model.salesforce.stg_salesforce__account", "model.salesforce.stg_salesforce__contact", "model.salesforce.stg_salesforce__user"], "model.salesforce.salesforce__owner_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user"], "model.salesforce.salesforce__opportunity_line_item_enhanced": ["model.salesforce.stg_salesforce__opportunity_line_item", "model.salesforce.stg_salesforce__product_2"], "model.salesforce.salesforce__sales_snapshot": ["model.salesforce.salesforce__opportunity_enhanced"], "model.salesforce.salesforce__opportunity_enhanced": ["model.salesforce.stg_salesforce__account", "model.salesforce.stg_salesforce__opportunity", "model.salesforce.stg_salesforce__record_type", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role"], "model.salesforce.salesforce__manager_performance": ["model.salesforce.int_salesforce__opportunity_aggregation_by_owner", "model.salesforce.stg_salesforce__user", "model.salesforce.stg_salesforce__user_role"], "model.salesforce.stg_salesforce__user": ["source.salesforce.salesforce.user"], "model.salesforce.stg_salesforce__lead": ["source.salesforce.salesforce.lead"], "model.salesforce.stg_salesforce__opportunity": ["source.salesforce.salesforce.opportunity"], "model.salesforce.stg_salesforce__task": ["source.salesforce.salesforce.task"], "model.salesforce.stg_salesforce__contact": ["source.salesforce.salesforce.contact"], "model.salesforce.stg_salesforce__campaign_member": ["source.salesforce.salesforce.campaign_member"], "model.salesforce.stg_salesforce__event": ["source.salesforce.salesforce.event"], "model.salesforce.stg_salesforce__record_type": ["source.salesforce.salesforce.record_type"], "model.salesforce.stg_salesforce__campaign": ["source.salesforce.salesforce.campaign"], "model.salesforce.stg_salesforce__user_role": ["source.salesforce.salesforce.user_role"], "model.salesforce.stg_salesforce__order": ["source.salesforce.salesforce.order"], "model.salesforce.stg_salesforce__product_2": ["source.salesforce.salesforce.product_2"], "model.salesforce.stg_salesforce__opportunity_line_item": ["source.salesforce.salesforce.opportunity_line_item"], "model.salesforce.stg_salesforce__account": ["source.salesforce.salesforce.account"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.stg_salesforce__lead"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__opportunity_enhanced", "model.salesforce.stg_salesforce__user"], "model.salesforce.salesforce__account_daily_history": ["model.salesforce.stg_salesforce__account_history"], "model.salesforce.salesforce__contact_daily_history": ["model.salesforce.stg_salesforce__contact_history"], "model.salesforce.salesforce__campaign_daily_history": ["source.salesforce.salesforce_history.campaign"], "model.salesforce.salesforce__opportunity_daily_history": ["model.salesforce.stg_salesforce__opportunity_history"], "model.salesforce.stg_salesforce__contact_history": ["source.salesforce.salesforce_history.contact"], "model.salesforce.stg_salesforce__account_history": ["source.salesforce.salesforce_history.account"], "model.salesforce.stg_salesforce__opportunity_history": ["source.salesforce.salesforce_history.opportunity"], "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.not_null_salesforce__campaign_performance_campaign_id.2efbe258b4": ["model.salesforce.salesforce__campaign_performance"], "test.salesforce.unique_salesforce__campaign_performance_campaign_id.aea6ce66c5": ["model.salesforce.salesforce__campaign_performance"], "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4": ["model.salesforce.stg_salesforce__account"], "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7": ["model.salesforce.stg_salesforce__account"], "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": ["model.salesforce.stg_salesforce__opportunity"], "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": ["model.salesforce.stg_salesforce__opportunity"], "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": ["model.salesforce.stg_salesforce__user"], "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152": ["model.salesforce.stg_salesforce__user"], "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": ["model.salesforce.stg_salesforce__user_role"], "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718": ["model.salesforce.stg_salesforce__user_role"], "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78": ["model.salesforce.stg_salesforce__contact"], "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e": ["model.salesforce.stg_salesforce__contact"], "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": ["model.salesforce.stg_salesforce__event"], "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9": ["model.salesforce.stg_salesforce__event"], "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": ["model.salesforce.stg_salesforce__lead"], "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282": ["model.salesforce.stg_salesforce__lead"], "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": ["model.salesforce.stg_salesforce__opportunity_line_item"], "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": ["model.salesforce.stg_salesforce__opportunity_line_item"], "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f": ["model.salesforce.stg_salesforce__order"], "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c": ["model.salesforce.stg_salesforce__order"], "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": ["model.salesforce.stg_salesforce__product_2"], "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": ["model.salesforce.stg_salesforce__product_2"], "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9": ["model.salesforce.stg_salesforce__task"], "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605": ["model.salesforce.stg_salesforce__task"], "test.salesforce.not_null_stg_salesforce__campaign_campaign_id.8a70e791fc": ["model.salesforce.stg_salesforce__campaign"], "test.salesforce.unique_stg_salesforce__campaign_campaign_id.bb510c55b8": ["model.salesforce.stg_salesforce__campaign"], "test.salesforce.not_null_stg_salesforce__campaign_member_campaign_member_id.d1d111912d": ["model.salesforce.stg_salesforce__campaign_member"], "test.salesforce.unique_stg_salesforce__campaign_member_campaign_member_id.c16f72906a": ["model.salesforce.stg_salesforce__campaign_member"], "test.salesforce.not_null_stg_salesforce__record_type_record_type_id.68299cd5d2": ["model.salesforce.stg_salesforce__record_type"], "test.salesforce.unique_stg_salesforce__record_type_record_type_id.be0e234aa9": ["model.salesforce.stg_salesforce__record_type"], "test.salesforce.unique_salesforce__campaign_daily_history_campaign_day_id.78f6f75ca8": ["model.salesforce.salesforce__campaign_daily_history"], "test.salesforce.not_null_salesforce__campaign_daily_history_campaign_day_id.05be30c879": ["model.salesforce.salesforce__campaign_daily_history"], "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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": ["model.salesforce.stg_salesforce__account_history"], "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f": ["model.salesforce.stg_salesforce__account_history"], "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": ["model.salesforce.stg_salesforce__contact_history"], "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": ["model.salesforce.stg_salesforce__contact_history"], "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": ["model.salesforce.stg_salesforce__opportunity_history"], "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": ["model.salesforce.stg_salesforce__opportunity_history"], "source.salesforce.salesforce.account": [], "source.salesforce.salesforce.opportunity": [], "source.salesforce.salesforce.user": [], "source.salesforce.salesforce.user_role": [], "source.salesforce.salesforce.contact": [], "source.salesforce.salesforce.event": [], "source.salesforce.salesforce.lead": [], "source.salesforce.salesforce.opportunity_line_item": [], "source.salesforce.salesforce.order": [], "source.salesforce.salesforce.product_2": [], "source.salesforce.salesforce.task": [], "source.salesforce.salesforce.campaign": [], "source.salesforce.salesforce.campaign_member": [], "source.salesforce.salesforce.record_type": [], "source.salesforce.salesforce.fivetran_formula": [], "source.salesforce.salesforce.fivetran_formula_model": [], "source.salesforce.salesforce_history.campaign": [], "source.salesforce.salesforce_history.account": [], "source.salesforce.salesforce_history.contact": [], "source.salesforce.salesforce_history.opportunity": []}, "child_map": {"seed.salesforce_integration_tests.sf_opportunity_data": [], "seed.salesforce_integration_tests.sf_user_role_data": [], "seed.salesforce_integration_tests.sf_opportunity_history_data": [], "seed.salesforce_integration_tests.sf_campaign_history_data": [], "seed.salesforce_integration_tests.sf_contact_history_data": [], "seed.salesforce_integration_tests.sf_account_history_data": [], "seed.salesforce_integration_tests.sf_product_2_data": [], "seed.salesforce_integration_tests.sf_campaign_member_data": [], "seed.salesforce_integration_tests.sf_opportunity_line_item_data": [], "seed.salesforce_integration_tests.sf_event_data": [], "seed.salesforce_integration_tests.sf_account_data": [], "seed.salesforce_integration_tests.sf_lead_data": [], "seed.salesforce_integration_tests.sf_contact_data": [], "seed.salesforce_integration_tests.sf_order_data": [], "seed.salesforce_integration_tests.sf_record_type_data": [], "seed.salesforce_integration_tests.sf_user_data": [], "seed.salesforce_integration_tests.sf_task_data": [], "seed.salesforce_integration_tests.sf_campaign_data": [], "model.salesforce.salesforce__campaign_performance": ["test.salesforce.not_null_salesforce__campaign_performance_campaign_id.2efbe258b4", "test.salesforce.unique_salesforce__campaign_performance_campaign_id.aea6ce66c5"], "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__contact_enhanced": ["test.salesforce.not_null_salesforce__contact_enhanced_contact_id.8c317adf93", "test.salesforce.unique_salesforce__contact_enhanced_contact_id.3a0def3b1e"], "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__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__manager_performance": ["test.salesforce.not_null_salesforce__manager_performance_manager_id.67d21c2781", "test.salesforce.unique_salesforce__manager_performance_manager_id.4adc491650"], "model.salesforce.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.not_null_stg_salesforce__user_user_id.ac0ab26d65", "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152"], "model.salesforce.stg_salesforce__lead": ["model.salesforce.int_salesforce__date_spine", "model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026", "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282"], "model.salesforce.stg_salesforce__opportunity": ["model.salesforce.salesforce__campaign_performance", "model.salesforce.salesforce__daily_activity", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd", "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a"], "model.salesforce.stg_salesforce__task": ["model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9", "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605"], "model.salesforce.stg_salesforce__contact": ["model.salesforce.salesforce__contact_enhanced", "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78", "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e"], "model.salesforce.stg_salesforce__campaign_member": ["model.salesforce.salesforce__campaign_performance", "test.salesforce.not_null_stg_salesforce__campaign_member_campaign_member_id.d1d111912d", "test.salesforce.unique_stg_salesforce__campaign_member_campaign_member_id.c16f72906a"], "model.salesforce.stg_salesforce__event": ["model.salesforce.salesforce__daily_activity", "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8", "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9"], "model.salesforce.stg_salesforce__record_type": ["model.salesforce.salesforce__campaign_performance", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__record_type_record_type_id.68299cd5d2", "test.salesforce.unique_stg_salesforce__record_type_record_type_id.be0e234aa9"], "model.salesforce.stg_salesforce__campaign": ["model.salesforce.salesforce__campaign_performance", "test.salesforce.not_null_stg_salesforce__campaign_campaign_id.8a70e791fc", "test.salesforce.unique_stg_salesforce__campaign_campaign_id.bb510c55b8"], "model.salesforce.stg_salesforce__user_role": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd", "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718"], "model.salesforce.stg_salesforce__order": ["test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f", "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c"], "model.salesforce.stg_salesforce__product_2": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a", "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61"], "model.salesforce.stg_salesforce__opportunity_line_item": ["model.salesforce.salesforce__opportunity_line_item_enhanced", "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072", "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902"], "model.salesforce.stg_salesforce__account": ["model.salesforce.salesforce__contact_enhanced", "model.salesforce.salesforce__opportunity_enhanced", "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4", "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7"], "model.salesforce.int_salesforce__date_spine": ["model.salesforce.salesforce__daily_activity"], "model.salesforce.int_salesforce__opportunity_aggregation_by_owner": ["model.salesforce.salesforce__manager_performance", "model.salesforce.salesforce__owner_performance"], "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__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__campaign_daily_history": ["test.salesforce.not_null_salesforce__campaign_daily_history_campaign_day_id.05be30c879", "test.salesforce.unique_salesforce__campaign_daily_history_campaign_day_id.78f6f75ca8"], "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.stg_salesforce__contact_history": ["model.salesforce.salesforce__contact_daily_history", "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf", "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d"], "model.salesforce.stg_salesforce__account_history": ["model.salesforce.salesforce__account_daily_history", "test.salesforce.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e", "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f"], "model.salesforce.stg_salesforce__opportunity_history": ["model.salesforce.salesforce__opportunity_daily_history", "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0", "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67"], "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.not_null_salesforce__campaign_performance_campaign_id.2efbe258b4": [], "test.salesforce.unique_salesforce__campaign_performance_campaign_id.aea6ce66c5": [], "test.salesforce.not_null_stg_salesforce__account_account_id.1e0ff361d4": [], "test.salesforce.unique_stg_salesforce__account_account_id.6d58a39ba7": [], "test.salesforce.not_null_stg_salesforce__opportunity_opportunity_id.234c5e60bd": [], "test.salesforce.unique_stg_salesforce__opportunity_opportunity_id.367b0f577a": [], "test.salesforce.not_null_stg_salesforce__user_user_id.ac0ab26d65": [], "test.salesforce.unique_stg_salesforce__user_user_id.9a29b41152": [], "test.salesforce.not_null_stg_salesforce__user_role_user_role_id.949036e9bd": [], "test.salesforce.unique_stg_salesforce__user_role_user_role_id.1259050718": [], "test.salesforce.not_null_stg_salesforce__contact_contact_id.d7c02bef78": [], "test.salesforce.unique_stg_salesforce__contact_contact_id.0cc2c0609e": [], "test.salesforce.not_null_stg_salesforce__event_event_id.e964b30db8": [], "test.salesforce.unique_stg_salesforce__event_event_id.13f7c8c0d9": [], "test.salesforce.not_null_stg_salesforce__lead_lead_id.e2ba6b2026": [], "test.salesforce.unique_stg_salesforce__lead_lead_id.ba8b21e282": [], "test.salesforce.not_null_stg_salesforce__opportunity_line_item_opportunity_line_item_id.b5d2465072": [], "test.salesforce.unique_stg_salesforce__opportunity_line_item_opportunity_line_item_id.c18042d902": [], "test.salesforce.not_null_stg_salesforce__order_order_id.4782f3b34f": [], "test.salesforce.unique_stg_salesforce__order_order_id.12a96b4e3c": [], "test.salesforce.not_null_stg_salesforce__product_2_product_2_id.84aed29e8a": [], "test.salesforce.unique_stg_salesforce__product_2_product_2_id.b4bc489d61": [], "test.salesforce.not_null_stg_salesforce__task_task_id.aabe11a5d9": [], "test.salesforce.unique_stg_salesforce__task_task_id.73684ed605": [], "test.salesforce.not_null_stg_salesforce__campaign_campaign_id.8a70e791fc": [], "test.salesforce.unique_stg_salesforce__campaign_campaign_id.bb510c55b8": [], "test.salesforce.not_null_stg_salesforce__campaign_member_campaign_member_id.d1d111912d": [], "test.salesforce.unique_stg_salesforce__campaign_member_campaign_member_id.c16f72906a": [], "test.salesforce.not_null_stg_salesforce__record_type_record_type_id.68299cd5d2": [], "test.salesforce.unique_stg_salesforce__record_type_record_type_id.be0e234aa9": [], "test.salesforce.unique_salesforce__campaign_daily_history_campaign_day_id.78f6f75ca8": [], "test.salesforce.not_null_salesforce__campaign_daily_history_campaign_day_id.05be30c879": [], "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.not_null_stg_salesforce__account_history_history_unique_key.e946c6dd0e": [], "test.salesforce.unique_stg_salesforce__account_history_history_unique_key.c378da769f": [], "test.salesforce.not_null_stg_salesforce__contact_history_history_unique_key.673cb181cf": [], "test.salesforce.unique_stg_salesforce__contact_history_history_unique_key.215181e10d": [], "test.salesforce.not_null_stg_salesforce__opportunity_history_history_unique_key.32fa6270e0": [], "test.salesforce.unique_stg_salesforce__opportunity_history_history_unique_key.b5b08bda67": [], "source.salesforce.salesforce.account": ["model.salesforce.stg_salesforce__account"], "source.salesforce.salesforce.opportunity": ["model.salesforce.stg_salesforce__opportunity"], "source.salesforce.salesforce.user": ["model.salesforce.stg_salesforce__user"], "source.salesforce.salesforce.user_role": ["model.salesforce.stg_salesforce__user_role"], "source.salesforce.salesforce.contact": ["model.salesforce.stg_salesforce__contact"], "source.salesforce.salesforce.event": ["model.salesforce.stg_salesforce__event"], "source.salesforce.salesforce.lead": ["model.salesforce.stg_salesforce__lead"], "source.salesforce.salesforce.opportunity_line_item": ["model.salesforce.stg_salesforce__opportunity_line_item"], "source.salesforce.salesforce.order": ["model.salesforce.stg_salesforce__order"], "source.salesforce.salesforce.product_2": ["model.salesforce.stg_salesforce__product_2"], "source.salesforce.salesforce.task": ["model.salesforce.stg_salesforce__task"], "source.salesforce.salesforce.campaign": ["model.salesforce.stg_salesforce__campaign"], "source.salesforce.salesforce.campaign_member": ["model.salesforce.stg_salesforce__campaign_member"], "source.salesforce.salesforce.record_type": ["model.salesforce.stg_salesforce__record_type"], "source.salesforce.salesforce.fivetran_formula": [], "source.salesforce.salesforce.fivetran_formula_model": [], "source.salesforce.salesforce_history.campaign": ["model.salesforce.salesforce__campaign_daily_history"], "source.salesforce.salesforce_history.account": ["model.salesforce.stg_salesforce__account_history"], "source.salesforce.salesforce_history.contact": ["model.salesforce.stg_salesforce__contact_history"], "source.salesforce.salesforce_history.opportunity": ["model.salesforce.stg_salesforce__opportunity_history"]}, "group_map": {}, "saved_queries": {}, "semantic_models": {}, "unit_tests": {}, "functions": {}} \ No newline at end of file diff --git a/integration_tests/ci/test_scenarios.yml b/integration_tests/ci/test_scenarios.yml index 21377b09..6e747d63 100644 --- a/integration_tests/ci/test_scenarios.yml +++ b/integration_tests/ci/test_scenarios.yml @@ -19,14 +19,16 @@ test_scenarios: vars: {} include_incremental: false - - name: "user role disabled" + - name: "features disabled" vars: salesforce__user_role_enabled: false + salesforce__campaign_enabled: false include_incremental: false - name: "history enabled" vars: salesforce__account_history_enabled: true + salesforce__campaign_history_enabled: true salesforce__contact_history_enabled: true salesforce__opportunity_history_enabled: true include_incremental: true diff --git a/integration_tests/dbt_project.yml b/integration_tests/dbt_project.yml index 5fa5c4ea..32d4e872 100644 --- a/integration_tests/dbt_project.yml +++ b/integration_tests/dbt_project.yml @@ -1,5 +1,5 @@ name: 'salesforce_integration_tests' -version: '2.2.0' +version: '2.3.0' config-version: 2 profile: 'integration_tests' @@ -12,6 +12,7 @@ models: vars: # enable history models when generating docs! + # salesforce__campaign_history_enabled: true # @docs-include # salesforce__contact_history_enabled: true # @docs-include # salesforce__account_history_enabled: true # @docs-include # salesforce__opportunity_history_enabled: true # @docs-include @@ -21,7 +22,10 @@ vars: salesforce_history_schema: salesforce_integrations_tests_4 salesforce_account_identifier: "sf_account_data" + salesforce_campaign_identifier: "sf_campaign_data" + salesforce_campaign_member_identifier: "sf_campaign_member_data" salesforce_opportunity_identifier: "sf_opportunity_data" + salesforce_record_type_identifier: "sf_record_type_data" salesforce_user_identifier: "sf_user_data" salesforce_user_role_identifier: "sf_user_role_data" salesforce_contact_identifier: "sf_contact_data" @@ -33,6 +37,7 @@ vars: salesforce_opportunity_line_item_identifier: "sf_opportunity_line_item_data" ##history mode identifiers + salesforce_campaign_history_identifier: "sf_campaign_history_data" salesforce_account_history_identifier: "sf_account_history_data" salesforce_contact_history_identifier: "sf_contact_history_data" salesforce_opportunity_history_identifier: "sf_opportunity_history_data" @@ -54,6 +59,36 @@ seeds: billing_longitude: float shipping_latitude: float shipping_longitude: float + sf_campaign_data: + +column_types: + _fivetran_synced: timestamp + _fivetran_active: boolean + start_date: timestamp + end_date: timestamp + is_active: boolean + is_deleted: boolean + budgeted_cost: float + actual_cost: float + number_of_leads: integer + number_of_converted_leads: integer + number_of_contacts: integer + number_of_responses: integer + number_of_opportunities: integer + number_of_won_opportunities: integer + amount_all_opportunities: float + sf_campaign_member_data: + +column_types: + _fivetran_synced: timestamp + _fivetran_active: boolean + created_date: timestamp + first_responded_date: timestamp + has_responded: boolean + is_deleted: boolean + sf_record_type_data: + +column_types: + _fivetran_synced: timestamp + _fivetran_deleted: boolean + is_active: boolean sf_opportunity_data: +column_types: _fivetran_synced: timestamp @@ -166,6 +201,25 @@ seeds: system_modstamp: timestamp is_deleted: boolean + sf_campaign_history_data: + +column_types: + _fivetran_synced: timestamp + _fivetran_active: boolean + _fivetran_start: timestamp + _fivetran_end: timestamp + start_date: timestamp + end_date: timestamp + is_active: boolean + is_deleted: boolean + budgeted_cost: float + actual_cost: float + number_of_leads: integer + number_of_converted_leads: integer + number_of_contacts: integer + number_of_responses: integer + number_of_opportunities: integer + number_of_won_opportunities: integer + amount_all_opportunities: float sf_account_history_data: +column_types: _fivetran_synced: timestamp diff --git a/integration_tests/seeds/sf_campaign_data.csv b/integration_tests/seeds/sf_campaign_data.csv new file mode 100644 index 00000000..4e65c3f4 --- /dev/null +++ b/integration_tests/seeds/sf_campaign_data.csv @@ -0,0 +1,5 @@ +_fivetran_synced,_fivetran_active,id,name,type,status,start_date,end_date,is_active,is_deleted,parent_id,budgeted_cost,actual_cost,number_of_leads,number_of_converted_leads,number_of_contacts,number_of_responses,number_of_opportunities,number_of_won_opportunities,amount_all_opportunities,description,campaign_member_record_type_id +2024-01-15 00:00:00,true,camp001AAA000001,Q1 Webinar Campaign,Webinar,Active,2024-01-01 00:00:00,2024-03-31 00:00:00,true,false,,5000,4200,50,10,30,20,8,3,95000,Q1 webinar campaign for lead generation,rtype001AAA00001 +2024-01-15 00:00:00,true,camp002AAA000002,Email Nurture Series,Email,Completed,2024-02-01 00:00:00,2024-04-30 00:00:00,false,false,,2000,1800,80,15,40,25,5,2,50000,Email nurture campaign, +2024-01-15 00:00:00,true,camp003AAA000003,Trade Show Spring,Other,Planned,2024-05-01 00:00:00,2024-05-31 00:00:00,true,false,,10000,,20,0,10,5,2,0,0,Spring trade show,rtype002AAA00002 +2024-01-15 00:00:00,true,camp004AAA000004,Social Media Ads,Social,Active,2024-03-01 00:00:00,2024-06-30 00:00:00,true,false,camp001AAA000001,8000,7500,120,25,60,40,12,5,140000,Paid social campaign, diff --git a/integration_tests/seeds/sf_campaign_history_data.csv b/integration_tests/seeds/sf_campaign_history_data.csv new file mode 100644 index 00000000..8aa7e416 --- /dev/null +++ b/integration_tests/seeds/sf_campaign_history_data.csv @@ -0,0 +1,5 @@ +_fivetran_active,_fivetran_start,_fivetran_end,_fivetran_synced,id,name,type,status,start_date,end_date,is_active,is_deleted,parent_id,budgeted_cost,actual_cost,number_of_leads,number_of_converted_leads,number_of_contacts,number_of_responses,number_of_opportunities,number_of_won_opportunities,amount_all_opportunities,description,campaign_member_record_type_id +true,2024-01-01 00:00:00,9999-12-31 23:59:59,2024-01-15 00:00:00,camp001AAA000001,Q1 Webinar Campaign,Webinar,Active,2024-01-01 00:00:00,2024-03-31 00:00:00,true,false,,5000,4200,50,10,30,20,8,3,95000,Q1 webinar campaign for lead generation,rtype001AAA00001 +false,2023-10-01 00:00:00,2023-12-31 23:59:59,2024-01-15 00:00:00,camp001AAA000001,Q1 Webinar Campaign,Webinar,Planned,2024-01-01 00:00:00,2024-03-31 00:00:00,true,false,,5000,0,0,0,0,0,0,0,0,Q1 webinar campaign for lead generation,rtype001AAA00001 +true,2024-02-01 00:00:00,9999-12-31 23:59:59,2024-02-15 00:00:00,camp002AAA000002,Email Nurture Series,Email,Completed,2024-02-01 00:00:00,2024-04-30 00:00:00,false,false,,2000,1800,80,15,40,25,5,2,50000,Email nurture campaign, +false,2023-11-01 00:00:00,2024-01-31 23:59:59,2024-02-15 00:00:00,camp002AAA000002,Email Nurture Series,Email,Active,2024-02-01 00:00:00,2024-04-30 00:00:00,true,false,,2000,900,40,5,20,10,2,1,25000,Email nurture campaign, diff --git a/integration_tests/seeds/sf_campaign_member_data.csv b/integration_tests/seeds/sf_campaign_member_data.csv new file mode 100644 index 00000000..a1610180 --- /dev/null +++ b/integration_tests/seeds/sf_campaign_member_data.csv @@ -0,0 +1,6 @@ +_fivetran_synced,_fivetran_active,id,account_id,campaign_id,contact_id,created_by_id,created_date,first_responded_date,has_opted_out_of_email,has_responded,is_deleted,last_modified_by_id,lead_id,lead_or_contact_id,lead_or_contact_owner_id,status +2024-01-15 00:00:00,true,mem001AAA000001,acct001AAAAAAA,camp001AAA000001,cont001AAAAAAA,user001AAAAAAA,2024-01-10 00:00:00,2024-01-12 00:00:00,false,true,false,user001AAAAAAA,,cont001AAAAAAA,user002AAAAAAA,Responded +2024-01-15 00:00:00,true,mem002AAA000002,acct002AAAAAAA,camp001AAA000001,,user001AAAAAAA,2024-01-10 00:00:00,,true,false,false,user001AAAAAAA,lead001AAAAAAA,lead001AAAAAAA,user002AAAAAAA,Sent +2024-01-15 00:00:00,true,mem003AAA000003,acct001AAAAAAA,camp002AAA000002,cont002AAAAAAA,user001AAAAAAA,2024-02-05 00:00:00,,false,false,false,user001AAAAAAA,,cont002AAAAAAA,user002AAAAAAA,Sent +2024-01-15 00:00:00,true,mem004AAA000004,acct002AAAAAAA,camp002AAA000002,,user001AAAAAAA,2024-02-05 00:00:00,2024-02-10 00:00:00,false,true,false,user001AAAAAAA,lead002AAAAAAA,lead002AAAAAAA,user002AAAAAAA,Responded +2024-01-15 00:00:00,true,mem005AAA000005,acct001AAAAAAA,camp003AAA000003,cont003AAAAAAA,user001AAAAAAA,2024-05-02 00:00:00,,false,false,false,user001AAAAAAA,,cont003AAAAAAA,user002AAAAAAA,Sent diff --git a/integration_tests/seeds/sf_record_type_data.csv b/integration_tests/seeds/sf_record_type_data.csv new file mode 100644 index 00000000..74acc4b2 --- /dev/null +++ b/integration_tests/seeds/sf_record_type_data.csv @@ -0,0 +1,3 @@ +_fivetran_synced,_fivetran_deleted,id,name,developer_name,sobject_type,is_active,description,namespace_prefix +2024-01-15 00:00:00,false,rtype001AAA00001,Campaign Standard,Campaign_Standard,Campaign,true,Standard campaign record type, +2024-01-15 00:00:00,false,rtype002AAA00002,Campaign Premium,Campaign_Premium,Campaign,true,Premium campaign record type, diff --git a/integration_tests/tests/consistency/consistency_campaign_performance.sql b/integration_tests/tests/consistency/consistency_campaign_performance.sql new file mode 100644 index 00000000..91c1aa37 --- /dev/null +++ b/integration_tests/tests/consistency/consistency_campaign_performance.sql @@ -0,0 +1,46 @@ +{{ config( + tags="fivetran_validations", + enabled=var('fivetran_validation_tests_enabled', false) +) }} + +-- this test ensures the campaign_performance end model matches the prior version +with prod as ( + select * + from {{ target.schema }}_salesforce_prod.salesforce__campaign_performance +), + +dev as ( + select * + from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance +), + +prod_not_in_dev as ( + -- rows from prod not found in dev + select * from prod + except distinct + select * from dev +), + +dev_not_in_prod as ( + -- rows from dev not found in prod + select * from dev + except distinct + select * from prod +), + +final as ( + select + *, + 'from prod' as source + from prod_not_in_dev + + union all -- union since we only care if rows are produced + + select + *, + 'from dev' as source + from dev_not_in_prod +) + +select * +from final diff --git a/integration_tests/tests/consistency/consistency_campaign_performance_count.sql b/integration_tests/tests/consistency/consistency_campaign_performance_count.sql new file mode 100644 index 00000000..9c664af6 --- /dev/null +++ b/integration_tests/tests/consistency/consistency_campaign_performance_count.sql @@ -0,0 +1,21 @@ +{{ config( + tags="fivetran_validations", + enabled=var('fivetran_validation_tests_enabled', false) +) }} + +-- this test is to make sure the row counts are the same between versions +with prod as ( + select count(*) as prod_rows + from {{ target.schema }}_salesforce_prod.salesforce__campaign_performance +), + +dev as ( + select count(*) as dev_rows + from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance +) + +-- test will return values and fail if the row counts don't match +select * +from prod +join dev + on prod.prod_rows != dev.dev_rows diff --git a/integration_tests/tests/integrity/integrity_campaign_performance.sql b/integration_tests/tests/integrity/integrity_campaign_performance.sql new file mode 100644 index 00000000..97b7b83a --- /dev/null +++ b/integration_tests/tests/integrity/integrity_campaign_performance.sql @@ -0,0 +1,80 @@ +{{ config( + tags="fivetran_validations", + enabled=var('fivetran_validation_tests_enabled', false) +) }} + +-- this test validates that the campaign_performance end model correctly reflects +-- source data: row parity with stg_campaign, member_count from stg_campaign_member, +-- and total_won_amount from stg_opportunity + +with end_model as ( + select * + from {{ target.schema }}_salesforce_dev.salesforce__campaign_performance +), + +-- verify 1:1 relationship with staging campaign -- no fanout, no missing rows +campaign_row_parity as ( + select count(*) as end_model_count + from end_model +), + +stg_campaign_count as ( + select count(*) as stg_count + from {{ target.schema }}_salesforce_dev.stg_salesforce__campaign +), + +row_parity_check as ( + select * + from campaign_row_parity + join stg_campaign_count + on end_model_count != stg_count +), + +-- verify member_count matches direct count from stg_campaign_member +member_count_check as ( + select + e.campaign_id, + e.member_count as end_model_member_count, + coalesce(m.stg_member_count, 0) as stg_member_count + from end_model e + left join ( + select + campaign_id, + count(*) as stg_member_count + from {{ target.schema }}_salesforce_dev.stg_salesforce__campaign_member + group by 1 + ) m + on e.campaign_id = m.campaign_id + where coalesce(e.member_count, 0) != coalesce(m.stg_member_count, 0) +), + +-- verify total_won_amount matches direct sum from stg_opportunity +won_amount_check as ( + select + e.campaign_id, + e.total_won_amount as end_model_won_amount, + o.stg_won_amount + from end_model e + left join ( + select + campaign_id, + sum(amount) as stg_won_amount + from {{ target.schema }}_salesforce_dev.stg_salesforce__opportunity + where is_won = true + and campaign_id is not null + group by 1 + ) o + on e.campaign_id = o.campaign_id + where coalesce(e.total_won_amount, 0) != coalesce(o.stg_won_amount, 0) +), + +final as ( + select campaign_id, 'member_count mismatch' as reason from member_count_check + union all + select campaign_id, 'total_won_amount mismatch' as reason from won_amount_check + union all + select cast(null as string), 'campaign row count mismatch' as reason from row_parity_check +) + +select * +from final diff --git a/macros/staging/get_campaign_columns.sql b/macros/staging/get_campaign_columns.sql new file mode 100644 index 00000000..95be0b92 --- /dev/null +++ b/macros/staging/get_campaign_columns.sql @@ -0,0 +1,35 @@ + +{% macro get_campaign_columns() %} + +{% set columns = [ + {"name": "_fivetran_active", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "actual_cost", "datatype": dbt.type_numeric()}, + {"name": "amount_all_opportunities", "datatype": dbt.type_numeric()}, + {"name": "budgeted_cost", "datatype": dbt.type_numeric()}, + {"name": "description", "datatype": dbt.type_string()}, + {"name": "end_date", "datatype": dbt.type_timestamp()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "is_active", "datatype": "boolean"}, + {"name": "is_deleted", "datatype": "boolean"}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "number_of_contacts", "datatype": dbt.type_int()}, + {"name": "number_of_converted_leads", "datatype": dbt.type_int()}, + {"name": "number_of_leads", "datatype": dbt.type_int()}, + {"name": "number_of_opportunities", "datatype": dbt.type_int()}, + {"name": "number_of_responses", "datatype": dbt.type_int()}, + {"name": "number_of_won_opportunities", "datatype": dbt.type_int()}, + {"name": "campaign_member_record_type_id", "datatype": dbt.type_string()}, + {"name": "parent_id", "datatype": dbt.type_string()}, + {"name": "start_date", "datatype": dbt.type_timestamp()}, + {"name": "status", "datatype": dbt.type_string()}, + {"name": "type", "datatype": dbt.type_string()} +] %} + +{{ salesforce.add_renamed_columns(columns) }} + +{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__campaign_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/staging/get_campaign_member_columns.sql b/macros/staging/get_campaign_member_columns.sql new file mode 100644 index 00000000..61eb6e2a --- /dev/null +++ b/macros/staging/get_campaign_member_columns.sql @@ -0,0 +1,30 @@ + +{% macro get_campaign_member_columns() %} + +{% set columns = [ + {"name": "_fivetran_active", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "account_id", "datatype": dbt.type_string()}, + {"name": "campaign_id", "datatype": dbt.type_string()}, + {"name": "contact_id", "datatype": dbt.type_string()}, + {"name": "created_by_id", "datatype": dbt.type_string()}, + {"name": "created_date", "datatype": dbt.type_timestamp()}, + {"name": "first_responded_date", "datatype": dbt.type_timestamp()}, + {"name": "has_opted_out_of_email", "datatype": "boolean"}, + {"name": "has_responded", "datatype": "boolean"}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "is_deleted", "datatype": "boolean"}, + {"name": "last_modified_by_id", "datatype": dbt.type_string()}, + {"name": "lead_id", "datatype": dbt.type_string()}, + {"name": "lead_or_contact_id", "datatype": dbt.type_string()}, + {"name": "lead_or_contact_owner_id", "datatype": dbt.type_string()}, + {"name": "status", "datatype": dbt.type_string()} +] %} + +{{ salesforce.add_renamed_columns(columns) }} + +{{ fivetran_utils.add_pass_through_columns(columns, var('salesforce__campaign_member_pass_through_columns')) }} + +{{ return(columns) }} + +{% endmacro %} diff --git a/macros/staging/get_record_type_columns.sql b/macros/staging/get_record_type_columns.sql new file mode 100644 index 00000000..f8d2d12b --- /dev/null +++ b/macros/staging/get_record_type_columns.sql @@ -0,0 +1,20 @@ + +{% macro get_record_type_columns() %} + +{% set columns = [ + {"name": "_fivetran_deleted", "datatype": "boolean"}, + {"name": "_fivetran_synced", "datatype": dbt.type_timestamp()}, + {"name": "description", "datatype": dbt.type_string()}, + {"name": "developer_name", "datatype": dbt.type_string()}, + {"name": "id", "datatype": dbt.type_string()}, + {"name": "is_active", "datatype": "boolean"}, + {"name": "name", "datatype": dbt.type_string()}, + {"name": "namespace_prefix", "datatype": dbt.type_string()}, + {"name": "sobject_type", "datatype": dbt.type_string()} +] %} + +{{ salesforce.add_renamed_columns(columns) }} + +{{ return(columns) }} + +{% endmacro %} diff --git a/models/salesforce/salesforce.yml b/models/salesforce/salesforce.yml index 045b98a6..7eb68690 100644 --- a/models/salesforce/salesforce.yml +++ b/models/salesforce/salesforce.yml @@ -230,6 +230,8 @@ models: description: Percentage of estimated confidence in closing the opportunity. - name: record_type_id description: ID of the record type assigned to this object. + - name: opportunity_record_type_name + description: Name of the record type assigned to this opportunity. Only present if the record_type table is enabled. - name: stage_name description: Required. Current stage of this record. The StageName field controls several other fields on an opportunity. - name: synced_quote_id @@ -550,4 +552,67 @@ models: - name: product_revenue_installment_period description: '{{ doc("product_revenue_installment_period") }}' - name: product_revenue_schedule_type - description: '{{ doc("product_revenue_schedule_type") }}' \ No newline at end of file + description: '{{ doc("product_revenue_schedule_type") }}' + + - name: salesforce__campaign_performance + description: Each record represents a campaign, enriched with pipeline, revenue, member volume, conversion rates, and ROI metrics. + columns: + - name: campaign_id + description: The unique, system-generated ID assigned during creation. + tests: + - not_null + - unique + - name: campaign_name + description: Name of the campaign. + - name: campaign_type + description: Type of campaign, such as Direct Mail, Email, or Webinar. + - name: campaign_status + description: Status of the campaign, such as Planned, In Progress, or Completed. + - name: start_date + description: Starting date for the campaign. + - name: end_date + description: Ending date for the campaign. + - name: is_active + description: Indicates whether the campaign is active (true) or not (false). + - name: parent_campaign_id + description: The ID of the parent campaign, if applicable. + - name: budgeted_cost + description: Amount of money budgeted for the campaign. + - name: actual_cost + description: Amount of money spent to run the campaign. + - name: number_of_leads + description: Number of leads associated with the campaign. + - name: number_of_converted_leads + description: Number of leads associated with the campaign that have been converted. + - name: number_of_contacts + description: Number of contacts associated with the campaign. + - name: number_of_responses + description: Number of contacts and leads that responded to the campaign. + - name: number_of_opportunities + description: Number of opportunities where this campaign is the primary campaign source. + - name: number_of_won_opportunities + description: Number of closed-won opportunities where this campaign is the primary campaign source. + - name: total_pipeline_amount + description: Total amount of all open and closed opportunities where this campaign is the primary campaign source. + - name: campaign_member_record_type_name + description: Name of the campaign member record type associated with this campaign. Only present if the record_type table is enabled. + - name: campaign_member_count + description: Total number of campaign members (contacts and leads) associated with this campaign. Only present if the campaign_member table is enabled. + - name: opted_out_of_email_count + description: Number of campaign members who have opted out of email communications. Only present if the campaign_member table is enabled. + - name: responded_count + description: Number of campaign members who have responded to the campaign. Only present if the campaign_member table is enabled. + - name: contact_count + description: Number of campaign members who are contacts. Only present if the campaign_member table is enabled. + - name: lead_count + description: Number of campaign members who are leads. Only present if the campaign_member table is enabled. + - name: total_won_amount + description: Sum of the closed-won opportunity amounts where this campaign is the primary campaign source. + - name: win_rate + description: Ratio of won opportunities to total opportunities. Null if there are no opportunities. + - name: cost_per_opportunity + description: Actual cost divided by the number of opportunities. Null if actual cost is not set. + - name: cost_per_won_opportunity + description: Actual cost divided by the number of won opportunities. Null if actual cost is not set. + - name: roi + description: Return on investment, calculated as (total_won_amount - actual_cost) / actual_cost. Null if actual cost is not set. \ No newline at end of file diff --git a/models/salesforce/salesforce__campaign_performance.sql b/models/salesforce/salesforce__campaign_performance.sql new file mode 100644 index 00000000..575bc749 --- /dev/null +++ b/models/salesforce/salesforce__campaign_performance.sql @@ -0,0 +1,107 @@ +--This model will only run if you have the underlying campaign table. +{{ config(enabled=var('salesforce__campaign_enabled', True)) }} + +{% set campaign_member_enabled = var('salesforce__campaign_member_enabled', True) %} +{% set record_type_enabled = var('salesforce__record_type_enabled', True) %} + +with campaign as ( + + select * + from {{ ref('stg_salesforce__campaign') }} +), + +opportunity as ( + + select + campaign_id, + sum(coalesce(amount, 0)) as total_won_amount + from {{ ref('stg_salesforce__opportunity') }} + where is_won = true + and campaign_id is not null + group by 1 +), + +{% if campaign_member_enabled %} +campaign_member as ( + + select + campaign_id, + count(*) as campaign_member_count, + count(contact_id) as contact_count, + count(lead_id) as lead_count, + sum(case when has_opted_out_of_email then 1 else 0 end) as opted_out_of_email_count, + sum(case when has_responded then 1 else 0 end) as responded_count + from {{ ref('stg_salesforce__campaign_member') }} + group by 1 +), +{% endif %} + +{% if record_type_enabled %} +record_type as ( + + select * + from {{ ref('stg_salesforce__record_type') }} + where lower(sobject_type) = 'campaignmember' +), +{% endif %} + +final as ( + + select + campaign.campaign_id, + campaign.campaign_name, + campaign.campaign_type, + campaign.campaign_status, + campaign.start_date, + campaign.end_date, + campaign.is_active, + campaign.parent_campaign_id, + campaign.budgeted_cost, + campaign.actual_cost, + campaign.number_of_leads, + campaign.number_of_converted_leads, + campaign.number_of_contacts, + campaign.number_of_responses, + campaign.number_of_opportunities, + campaign.number_of_won_opportunities, + campaign.total_pipeline_amount, + + {% if campaign_member_enabled %} + campaign_member.campaign_member_count, + campaign_member.opted_out_of_email_count, + campaign_member.responded_count, + campaign_member.contact_count, + campaign_member.lead_count, + {% endif %} + + {% if record_type_enabled %} + record_type.record_type_name as campaign_member_record_type_name, + {% endif %} + + opportunity.total_won_amount, + + -- Derived metrics + {{ dbt_utils.safe_divide('campaign.number_of_won_opportunities', 'campaign.number_of_opportunities') }} as win_rate, + {{ dbt_utils.safe_divide('campaign.actual_cost', 'campaign.number_of_opportunities') }} as cost_per_opportunity, + {{ dbt_utils.safe_divide('campaign.actual_cost', 'campaign.number_of_won_opportunities') }} as cost_per_won_opportunity, + {{ dbt_utils.safe_divide('(opportunity.total_won_amount - campaign.actual_cost)', 'campaign.actual_cost') }} as roi + + {{ fivetran_utils.persist_pass_through_columns(pass_through_variable='salesforce__campaign_pass_through_columns', identifier='campaign') }} + + from campaign + left join opportunity + on campaign.campaign_id = opportunity.campaign_id + + {% if campaign_member_enabled %} + left join campaign_member + on campaign.campaign_id = campaign_member.campaign_id + {% endif %} + + {% if record_type_enabled %} + left join record_type + on campaign.campaign_member_record_type_id = record_type.record_type_id + {% endif %} +) + +select * +from final diff --git a/models/salesforce/salesforce__opportunity_enhanced.sql b/models/salesforce/salesforce__opportunity_enhanced.sql index 145ff8b6..01ca58e3 100644 --- a/models/salesforce/salesforce__opportunity_enhanced.sql +++ b/models/salesforce/salesforce__opportunity_enhanced.sql @@ -1,3 +1,5 @@ +{% set record_type_enabled = var('salesforce__record_type_enabled', True) %} + with opportunity as ( select * @@ -23,7 +25,16 @@ account as ( select * from {{ ref('stg_salesforce__account') }} -), +), + +{% if record_type_enabled %} +record_type as ( + + select * + from {{ ref('stg_salesforce__record_type') }} + where lower(sobject_type) = 'opportunity' +), +{% endif %} add_fields as ( @@ -53,6 +64,10 @@ add_fields as ( user_role.rollup_description as opportunity_owner_rollup_description, {% endif %} + {% if record_type_enabled %} + record_type.record_type_name as opportunity_record_type_name, + {% endif %} + case when opportunity.is_won then 'Won' when not opportunity.is_won and opportunity.is_closed then 'Lost' @@ -88,9 +103,14 @@ add_fields as ( -- If using user_role table, the following will be included, otherwise it will not. {% if var('salesforce__user_role_enabled', True) %} - left join user_role + left join user_role on opportunity_owner.user_role_id = user_role.user_role_id {% endif %} + + {% if record_type_enabled %} + left join record_type + on opportunity.record_type_id = record_type.record_type_id + {% endif %} ) select * diff --git a/models/salesforce/staging/src_salesforce.yml b/models/salesforce/staging/src_salesforce.yml index b27f4143..f060c817 100644 --- a/models/salesforce/staging/src_salesforce.yml +++ b/models/salesforce/staging/src_salesforce.yml @@ -1129,6 +1129,119 @@ sources: - 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’s ID or a lead’s 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. + - name: campaign + identifier: "{{ var('salesforce_campaign_identifier', 'campaign')}}" + description: Represents a marketing campaign, such as a direct mail promotion, webinar, or trade show. + columns: + - name: id + description: The unique, system-generated ID assigned during creation. + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: _fivetran_active + description: True if record is active, used to filter out only active records if History Mode is enabled. + - name: actual_cost + description: Amount of money spent to run the campaign. + - name: amount_all_opportunities + description: Total amount of all opportunities associated with the campaign. + - name: budgeted_cost + description: Amount of money budgeted for the campaign. + - name: description + description: Description of the campaign. + - name: end_date + description: Ending date for the campaign. + - name: is_active + description: Indicates whether the campaign is active (true) or not (false). + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: name + description: Required. Name of the campaign. + - name: number_of_contacts + description: Number of contacts associated with the campaign. + - name: number_of_converted_leads + description: Number of leads associated with the campaign that have been converted. + - name: number_of_leads + description: Number of leads associated with the campaign. + - name: number_of_opportunities + description: Number of opportunities associated with the campaign. + - name: number_of_responses + description: Number of contacts and leads that have a campaign member status where the Has Responded field is true. + - name: number_of_won_opportunities + description: Number of opportunities associated with the campaign that have a probability of 100% because they are closed and won. + - name: campaign_member_record_type_id + description: ID of the record type assigned to campaign members of this campaign. + - name: parent_id + description: The ID of the parent campaign, if applicable. + - name: start_date + description: Starting date for the campaign. + - name: status + description: Status of the campaign, such as Planned, In Progress, or Completed. + - name: type + description: Type of campaign, such as Direct Mail, Email, or Webinar. + + - name: campaign_member + identifier: "{{ var('salesforce_campaign_member_identifier', 'campaign_member')}}" + description: Represents the relationship between a campaign and either a lead or a contact. + columns: + - name: id + description: The unique, system-generated ID assigned during creation. + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: _fivetran_active + description: True if record is active, used to filter out only active records if History Mode is enabled. + - name: account_id + description: ID of the account associated with the contact or lead. + - name: campaign_id + description: Required. ID of the campaign. + - name: contact_id + description: ID of the contact associated with this campaign member. Either ContactId or LeadId must be specified. + - name: created_by_id + description: ID of the user who created the campaign member record. + - name: created_date + description: Date when the campaign member record was created. + - name: first_responded_date + description: Date when the contact or lead first responded to the campaign. + - name: has_opted_out_of_email + description: Indicates whether the contact or lead has opted out of email communications. + - name: has_responded + description: Indicates whether the contact or lead has responded to the campaign. + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: last_modified_by_id + description: ID of the user who last modified the campaign member record. + - name: lead_id + description: ID of the lead associated with this campaign member. Either ContactId or LeadId must be specified. + - name: lead_or_contact_id + description: ID of the lead or contact associated with this campaign member. + - name: lead_or_contact_owner_id + description: ID of the owner of the lead or contact associated with this campaign member. + - name: status + description: The status of the campaign member, such as Sent or Responded. + + - name: record_type + identifier: "{{ var('salesforce_record_type_identifier', 'record_type')}}" + config: + freshness: null + description: Represents a record type, which allows you to offer different business processes, picklist values, and page layouts to different users. + columns: + - name: id + description: The unique, system-generated ID assigned during creation. + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: _fivetran_deleted + description: True if the record has been deleted in Salesforce. + - name: description + description: Description of the record type. + - name: developer_name + description: The unique name of the object in the API. + - name: is_active + description: Indicates whether this record type is available for use. + - name: name + description: Label for this record type. This display value is the unique, identifying label visible to users. + - name: namespace_prefix + description: The namespace prefix associated with this object. + - name: sobject_type + description: The Salesforce object that this record type applies to. + - name: fivetran_formula description: Holds the formula fields for each of your custom fields diff --git a/models/salesforce/staging/stg_salesforce.yml b/models/salesforce/staging/stg_salesforce.yml index b3a79c19..1b759c59 100644 --- a/models/salesforce/staging/stg_salesforce.yml +++ b/models/salesforce/staging/stg_salesforce.yml @@ -959,5 +959,116 @@ models: - name: who_count description: Available to organizations that have Shared Activities enabled. Count of related TaskRelations pertaining to WhoId. - 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’s ID or a lead’s 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. + 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’s ID or a lead’s 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. + + - name: stg_salesforce__campaign + description: Represents a marketing campaign, such as a direct mail promotion, webinar, or trade show. + columns: + - name: campaign_id + description: The unique, system-generated ID assigned during creation. + tests: + - not_null + - unique + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: actual_cost + description: Amount of money spent to run the campaign. + - name: budgeted_cost + description: Amount of money budgeted for the campaign. + - name: campaign_description + description: Description of the campaign. + - name: campaign_name + description: Required. Name of the campaign. + - name: campaign_status + description: Status of the campaign, such as Planned, In Progress, or Completed. + - name: campaign_type + description: Type of campaign, such as Direct Mail, Email, or Webinar. + - name: end_date + description: Ending date for the campaign. + - name: is_active + description: Indicates whether the campaign is active (true) or not (false). + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: number_of_contacts + description: Number of contacts associated with the campaign. + - name: number_of_converted_leads + description: Number of leads associated with the campaign that have been converted. + - name: number_of_leads + description: Number of leads associated with the campaign. + - name: number_of_opportunities + description: Number of opportunities associated with the campaign. + - name: number_of_responses + description: Number of contacts and leads that have a campaign member status where the Has Responded field is true. + - name: number_of_won_opportunities + description: Number of opportunities associated with the campaign that have a probability of 100% because they are closed and won. + - name: campaign_member_record_type_id + description: ID of the record type assigned to campaign members of this campaign. + - name: parent_campaign_id + description: The ID of the parent campaign, if applicable. + - name: start_date + description: Starting date for the campaign. + - name: total_pipeline_amount + description: Total amount of all opportunities associated with the campaign. + + - name: stg_salesforce__campaign_member + description: Represents the relationship between a campaign and either a lead or a contact. + columns: + - name: campaign_member_id + description: The unique, system-generated ID assigned during creation. + tests: + - not_null + - unique + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: account_id + description: ID of the account associated with the contact or lead. + - name: campaign_id + description: ID of the campaign. + - name: contact_id + description: ID of the contact associated with this campaign member. + - name: created_by_id + description: ID of the user who created the campaign member record. + - name: created_date + description: Date when the campaign member record was created. + - name: first_responded_date + description: Date when the contact or lead first responded to the campaign. + - name: has_opted_out_of_email + description: Indicates whether the contact or lead has opted out of email communications. + - name: has_responded + description: Indicates whether the contact or lead has responded to the campaign. + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: last_modified_by_id + description: ID of the user who last modified the campaign member record. + - name: lead_id + description: ID of the lead associated with this campaign member. + - name: lead_or_contact_id + description: ID of the lead or contact associated with this campaign member. + - name: lead_or_contact_owner_id + description: ID of the owner of the lead or contact associated with this campaign member. + - name: status + description: The status of the campaign member, such as Sent or Responded. + + - name: stg_salesforce__record_type + description: Represents a record type, which lets you offer different business processes, picklist values, and page layouts to different users. + columns: + - name: record_type_id + description: The unique, system-generated ID assigned during creation. + tests: + - not_null + - unique + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: developer_name + description: The unique name of the object in the API. + - name: is_active + description: Indicates whether this record type is available for use. + - name: namespace_prefix + description: The namespace prefix associated with this object. + - name: record_type_description + description: Description of the record type. + - name: record_type_name + description: Label for this record type visible to users. + - name: sobject_type + description: The Salesforce object that this record type applies to. diff --git a/models/salesforce/staging/stg_salesforce__campaign.sql b/models/salesforce/staging/stg_salesforce__campaign.sql new file mode 100644 index 00000000..0c8bac29 --- /dev/null +++ b/models/salesforce/staging/stg_salesforce__campaign.sql @@ -0,0 +1,54 @@ +--To disable this model, set the salesforce__campaign_enabled within your dbt_project.yml file to False. +{{ config(enabled=var('salesforce__campaign_enabled', True)) }} + +{% set campaign_column_list = get_campaign_columns() -%} +{% set campaign_dict = column_list_to_dict(campaign_column_list) -%} + +with fields as ( + + select + + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(source('salesforce','campaign')), + staging_columns=campaign_column_list + ) + }} + + from {{ source('salesforce','campaign') }} +), + +final as ( + + select + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ salesforce.coalesce_rename("id", campaign_dict, alias="campaign_id") }}, + {{ salesforce.coalesce_rename("actual_cost", campaign_dict, datatype=dbt.type_numeric()) }}, + {{ salesforce.coalesce_rename("amount_all_opportunities", campaign_dict, alias="total_pipeline_amount", datatype=dbt.type_numeric()) }}, + {{ salesforce.coalesce_rename("budgeted_cost", campaign_dict, datatype=dbt.type_numeric()) }}, + {{ salesforce.coalesce_rename("campaign_member_record_type_id", campaign_dict) }}, + {{ salesforce.coalesce_rename("description", campaign_dict, alias="campaign_description") }}, + {{ salesforce.coalesce_rename("end_date", campaign_dict) }}, + {{ salesforce.coalesce_rename("is_active", campaign_dict) }}, + {{ salesforce.coalesce_rename("is_deleted", campaign_dict) }}, + {{ salesforce.coalesce_rename("name", campaign_dict, alias="campaign_name") }}, + {{ salesforce.coalesce_rename("number_of_contacts", campaign_dict) }}, + {{ salesforce.coalesce_rename("number_of_converted_leads", campaign_dict) }}, + {{ salesforce.coalesce_rename("number_of_leads", campaign_dict) }}, + {{ salesforce.coalesce_rename("number_of_opportunities", campaign_dict) }}, + {{ salesforce.coalesce_rename("number_of_responses", campaign_dict) }}, + {{ salesforce.coalesce_rename("number_of_won_opportunities", campaign_dict) }}, + {{ salesforce.coalesce_rename("parent_id", campaign_dict, alias="parent_campaign_id") }}, + {{ salesforce.coalesce_rename("start_date", campaign_dict) }}, + {{ salesforce.coalesce_rename("status", campaign_dict, alias="campaign_status") }}, + {{ salesforce.coalesce_rename("type", campaign_dict, alias="campaign_type") }} + + {{ fivetran_utils.fill_pass_through_columns('salesforce__campaign_pass_through_columns') }} + + from fields + where coalesce(_fivetran_active, true) +) + +select * +from final +where not coalesce(is_deleted, false) diff --git a/models/salesforce/staging/stg_salesforce__campaign_member.sql b/models/salesforce/staging/stg_salesforce__campaign_member.sql new file mode 100644 index 00000000..6010ca22 --- /dev/null +++ b/models/salesforce/staging/stg_salesforce__campaign_member.sql @@ -0,0 +1,49 @@ +--To disable this model, set the salesforce__campaign_member_enabled within your dbt_project.yml file to False. +{{ config(enabled=var('salesforce__campaign_member_enabled', True)) }} + +{% set campaign_member_column_list = get_campaign_member_columns() -%} +{% set campaign_member_dict = column_list_to_dict(campaign_member_column_list) -%} + +with fields as ( + + select + + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(source('salesforce','campaign_member')), + staging_columns=campaign_member_column_list + ) + }} + + from {{ source('salesforce','campaign_member') }} +), + +final as ( + + select + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ salesforce.coalesce_rename("id", campaign_member_dict, alias="campaign_member_id") }}, + {{ salesforce.coalesce_rename("account_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("campaign_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("contact_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("created_by_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("created_date", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("first_responded_date", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("has_opted_out_of_email", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("has_responded", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("is_deleted", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("last_modified_by_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("lead_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("lead_or_contact_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("lead_or_contact_owner_id", campaign_member_dict) }}, + {{ salesforce.coalesce_rename("status", campaign_member_dict) }} + + {{ fivetran_utils.fill_pass_through_columns('salesforce__campaign_member_pass_through_columns') }} + + from fields + where coalesce(_fivetran_active, true) +) + +select * +from final +where not coalesce(is_deleted, false) diff --git a/models/salesforce/staging/stg_salesforce__record_type.sql b/models/salesforce/staging/stg_salesforce__record_type.sql new file mode 100644 index 00000000..46757ba3 --- /dev/null +++ b/models/salesforce/staging/stg_salesforce__record_type.sql @@ -0,0 +1,38 @@ +--To disable this model, set the salesforce__record_type_enabled within your dbt_project.yml file to False. +{{ config(enabled=var('salesforce__record_type_enabled', True)) }} + +{% set record_type_column_list = get_record_type_columns() -%} +{% set record_type_dict = column_list_to_dict(record_type_column_list) -%} + +with fields as ( + + select + + {{ + fivetran_utils.fill_staging_columns( + source_columns=adapter.get_columns_in_relation(source('salesforce','record_type')), + staging_columns=record_type_column_list + ) + }} + + from {{ source('salesforce','record_type') }} +), + +final as ( + + select + cast(_fivetran_synced as {{ dbt.type_timestamp() }}) as _fivetran_synced, + {{ salesforce.coalesce_rename("id", record_type_dict, alias="record_type_id") }}, + {{ salesforce.coalesce_rename("description", record_type_dict, alias="record_type_description") }}, + {{ salesforce.coalesce_rename("developer_name", record_type_dict) }}, + {{ salesforce.coalesce_rename("is_active", record_type_dict) }}, + {{ salesforce.coalesce_rename("name", record_type_dict, alias="record_type_name") }}, + {{ salesforce.coalesce_rename("namespace_prefix", record_type_dict) }}, + {{ salesforce.coalesce_rename("sobject_type", record_type_dict) }} + + from fields + where not coalesce(_fivetran_deleted, false) +) + +select * +from final diff --git a/models/salesforce_history/salesforce__account_daily_history.sql b/models/salesforce_history/salesforce__account_daily_history.sql index 5162bfee..0a4177c8 100644 --- a/models/salesforce_history/salesforce__account_daily_history.sql +++ b/models/salesforce_history/salesforce__account_daily_history.sql @@ -8,34 +8,19 @@ } if target.type not in ['spark', 'databricks'] else ['date_day'], unique_key = 'account_day_id', incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert', - file_format = 'parquet', + file_format = 'delta', on_schema_change = 'fail' ) }} -{% if execute %} - {% set date_query %} - select - {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date - {% endset %} - - {% set last_date = run_query(date_query).columns[0][0]|string %} - - {# If only compiling, creates range going back 1 year #} - {% else %} - {% set last_date = dbt.dateadd("year", "-1", "current_date") %} - {% endif %} - +{% set first_date = var('account_history_start_date', var('global_history_start_date', '2020-01-01')) %} with spine as ( - {# Prioritizes variables over calculated dates #} - {% set first_date = var('account_history_start_date', var('global_history_start_date', '2020-01-01'))|string %} - {% set last_date = last_date|string %} {{ dbt_utils.date_spine( datepart="day", - start_date = "cast('" ~ first_date[0:10] ~ "'as date)", - end_date = "cast('" ~ last_date[0:10] ~ "'as date)" + start_date = "cast('" ~ first_date ~ "' as date)", + end_date = "cast(current_date as date)" ) }} ), diff --git a/models/salesforce_history/salesforce__campaign_daily_history.sql b/models/salesforce_history/salesforce__campaign_daily_history.sql new file mode 100644 index 00000000..1d83930d --- /dev/null +++ b/models/salesforce_history/salesforce__campaign_daily_history.sql @@ -0,0 +1,77 @@ +{{ + config( + enabled = var('salesforce__campaign_history_enabled', False), + materialized = 'incremental', + partition_by = { + 'field': 'date_day', + 'data_type': 'date' + } if target.type not in ['spark', 'databricks'] else ['date_day'], + unique_key = 'campaign_day_id', + incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert', + file_format = 'delta', + on_schema_change = 'fail' + ) +}} + +{% set first_date = var('campaign_history_start_date', var('global_history_start_date', '2020-01-01')) %} + +with spine as ( + + {{ dbt_utils.date_spine( + datepart="day", + start_date = "cast('" ~ first_date ~ "' as date)", + end_date = "cast(current_date as date)" + ) + }} +), + +campaign_history as ( + + select + id as campaign_id, + cast(_fivetran_start as {{ dbt.type_timestamp() }}) as _fivetran_start, + cast(_fivetran_end as {{ dbt.type_timestamp() }}) as _fivetran_end, + cast(_fivetran_start as date) as _fivetran_date, + {{ dbt_utils.generate_surrogate_key(['id', '_fivetran_start']) }} as history_unique_key, + {{ dbt_utils.star(from=source('salesforce_history','campaign'), + except=["id", "_fivetran_start", "_fivetran_end"]) }} + + from {{ source('salesforce_history','campaign') }} + + {% if is_incremental() %} + where cast(_fivetran_start as date) >= (select max(cast((_fivetran_start) as date)) from {{ this }}) + {% else %} + where cast(_fivetran_start as date) >= cast('{{ first_date }}' as date) + {% endif %} +), + +order_daily_values as ( + + select + *, + row_number() over ( + partition by _fivetran_date, campaign_id + order by _fivetran_start desc) as row_num + from campaign_history +), + +get_latest_daily_value as ( + + select * + from order_daily_values + where row_num = 1 +), + +daily_history as ( + + select + {{ dbt_utils.generate_surrogate_key(['spine.date_day','get_latest_daily_value.campaign_id']) }} as campaign_day_id, + cast(spine.date_day as date) as date_day, + get_latest_daily_value.* + from get_latest_daily_value + join spine on get_latest_daily_value._fivetran_start <= cast(spine.date_day as {{ dbt.type_timestamp() }}) + and get_latest_daily_value._fivetran_end >= cast(spine.date_day as {{ dbt.type_timestamp() }}) +) + +select * +from daily_history diff --git a/models/salesforce_history/salesforce__contact_daily_history.sql b/models/salesforce_history/salesforce__contact_daily_history.sql index 4c72f75e..f65fac57 100644 --- a/models/salesforce_history/salesforce__contact_daily_history.sql +++ b/models/salesforce_history/salesforce__contact_daily_history.sql @@ -8,34 +8,19 @@ } if target.type not in ['spark', 'databricks'] else ['date_day'], unique_key = 'contact_day_id', incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert', - file_format = 'parquet', + file_format = 'delta', on_schema_change = 'fail' ) }} -{% if execute %} - {% set date_query %} - select - {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date - {% endset %} - - {% set last_date = run_query(date_query).columns[0][0]|string %} - - {# If only compiling, creates range going back 1 year #} - {% else %} - {% set last_date = dbt.dateadd("year", "-1", "current_date") %} - {% endif %} - +{% set first_date = var('contact_history_start_date', var('global_history_start_date', '2020-01-01')) %} with spine as ( - {# Prioritizes variables over calculated dates #} - {% set first_date = var('contact_history_start_date', var('global_history_start_date', '2020-01-01'))|string %} - {% set last_date = last_date|string %} {{ dbt_utils.date_spine( datepart="day", - start_date = "cast('" ~ first_date[0:10] ~ "'as date)", - end_date = "cast('" ~ last_date[0:10] ~ "'as date)" + start_date = "cast('" ~ first_date ~ "' as date)", + end_date = "cast(current_date as date)" ) }} ), diff --git a/models/salesforce_history/salesforce__opportunity_daily_history.sql b/models/salesforce_history/salesforce__opportunity_daily_history.sql index 2339005d..75e1dce5 100644 --- a/models/salesforce_history/salesforce__opportunity_daily_history.sql +++ b/models/salesforce_history/salesforce__opportunity_daily_history.sql @@ -8,35 +8,20 @@ } if target.type not in ['spark', 'databricks'] else ['date_day'], unique_key = 'opportunity_day_id', incremental_strategy = 'insert_overwrite' if target.type in ('bigquery', 'spark', 'databricks') else 'delete+insert', - file_format = 'parquet', + file_format = 'delta', on_schema_change = 'fail' ) }} -{% if execute %} - {% set date_query %} - select - {{ dbt.date_trunc('day', dbt.current_timestamp_backcompat()) }} as max_date - {% endset %} - - {% set last_date = run_query(date_query).columns[0][0]|string %} - - {# If only compiling, creates range going back 1 year #} - {% else %} - {% set last_date = dbt.dateadd("year", "-1", "current_date") %} - {% endif %} - +{% set first_date = var('opportunity_history_start_date', var('global_history_start_date', '2020-01-01')) %} with spine as ( - {# Prioritizes variables over calculated dates #} - {% set first_date = var('opportunity_history_start_date', var('global_history_start_date', '2020-01-01'))|string %} - {% set last_date = last_date|string %} {{ dbt_utils.date_spine( datepart="day", - start_date = "cast('" ~ first_date[0:10] ~ "'as date)", - end_date = "cast('" ~ last_date[0:10] ~ "'as date)" + start_date = "cast('" ~ first_date ~ "' as date)", + end_date = "cast(current_date as date)" ) }} ), diff --git a/models/salesforce_history/salesforce_history.yml b/models/salesforce_history/salesforce_history.yml index 8b1dddc1..99383660 100644 --- a/models/salesforce_history/salesforce_history.yml +++ b/models/salesforce_history/salesforce_history.yml @@ -1,6 +1,67 @@ version: 2 models: + - name: salesforce__campaign_daily_history + description: Each record is a daily snapshot of a campaign, starting with its first active date and updating up toward either the current date (if still active) or its last active date. + columns: + - name: campaign_day_id + description: Surrogate key hashed on `date_day` and `campaign_id`. + tests: + - unique + - not_null + - name: date_day + description: Date on which the campaign had these field values. + - name: campaign_id + description: The unique, system-generated ID assigned during creation. + - 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. + - 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. + - 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. + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: history_unique_key + description: Surrogate key hashed on `_fivetran_start` and `campaign_id`. + - name: actual_cost + description: Amount of money spent to run the campaign. + - name: total_pipeline_amount + description: Total amount of all opportunities associated with the campaign. + - name: budgeted_cost + description: Amount of money budgeted for the campaign. + - name: campaign_member_record_type_id + description: ID of the record type assigned to campaign members of this campaign. + - name: campaign_description + description: Text description of the campaign. + - name: end_date + description: Ending date for the campaign. + - name: is_active + description: Indicates whether the campaign is active (true) or not (false). + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: campaign_name + description: Name of the campaign. + - name: number_of_contacts + description: Number of contacts associated with the campaign. + - name: number_of_converted_leads + description: Number of leads associated with the campaign that have been converted. + - name: number_of_leads + description: Number of leads associated with the campaign. + - name: number_of_opportunities + description: Number of opportunities where this campaign is the primary campaign source. + - name: number_of_responses + description: Number of contacts and leads that responded to the campaign. + - name: number_of_won_opportunities + description: Number of closed-won opportunities where this campaign is the primary campaign source. + - name: parent_campaign_id + description: The ID of the parent campaign, if applicable. + - name: start_date + description: Starting date for the campaign. + - name: campaign_status + description: Status of the campaign, such as Planned, In Progress, or Completed. + - name: campaign_type + description: Type of campaign, such as Direct Mail, Email, or Webinar. + - name: salesforce__account_daily_history 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: diff --git a/models/salesforce_history/staging/src_salesforce_history.yml b/models/salesforce_history/staging/src_salesforce_history.yml index a8981948..0ab2b106 100644 --- a/models/salesforce_history/staging/src_salesforce_history.yml +++ b/models/salesforce_history/staging/src_salesforce_history.yml @@ -12,6 +12,61 @@ sources: error_after: {count: 48, period: hour} tables: + - name: campaign + identifier: "{{ var('salesforce_campaign_history_identifier', 'campaign')}}" + description: Represents historical records of campaigns, which are outreach initiatives designed to generate leads and track revenue. + config: + enabled: "{{ var('salesforce__campaign_history_enabled', False) }}" + columns: + - name: id + description: The unique, system-generated ID assigned during creation. + - 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. + - 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. + - 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. + - name: _fivetran_synced + description: The time at which fivetran last synced this record. + - name: actual_cost + description: Amount of money spent to run the campaign. + - name: amount_all_opportunities + description: Total amount of all opportunities associated with the campaign. + - name: budgeted_cost + description: Amount of money budgeted for the campaign. + - name: campaign_member_record_type_id + description: ID of the record type assigned to campaign members of this campaign. + - name: description + description: Text description of the campaign. + - name: end_date + description: Ending date for the campaign. + - name: is_active + description: Indicates whether the campaign is active (true) or not (false). + - name: is_deleted + description: Indicates whether the object has been moved to the Recycle Bin (true) or not (false). + - name: name + description: Name of the campaign. + - name: number_of_contacts + description: Number of contacts associated with the campaign. + - name: number_of_converted_leads + description: Number of leads associated with the campaign that have been converted. + - name: number_of_leads + description: Number of leads associated with the campaign. + - name: number_of_opportunities + description: Number of opportunities where this campaign is the primary campaign source. + - name: number_of_responses + description: Number of contacts and leads that responded to the campaign. + - name: number_of_won_opportunities + description: Number of closed-won opportunities where this campaign is the primary campaign source. + - name: parent_id + description: The ID of the parent campaign, if applicable. + - name: start_date + description: Starting date for the campaign. + - name: status + description: Status of the campaign, such as Planned, In Progress, or Completed. + - name: type + description: Type of campaign, such as Direct Mail, Email, or Webinar. + - name: account identifier: "{{ var('salesforce_account_history_identifier', 'account')}}" description: Represents historical records of individual accounts, which are organizations or people involved with your business (such as customers, competitors, and partners). diff --git a/models/salesforce_history/staging/stg_salesforce__account_history.sql b/models/salesforce_history/staging/stg_salesforce__account_history.sql index ba9aed5c..2e137344 100644 --- a/models/salesforce_history/staging/stg_salesforce__account_history.sql +++ b/models/salesforce_history/staging/stg_salesforce__account_history.sql @@ -7,7 +7,7 @@ "field": "_fivetran_date", "data_type": "date" } if target.type not in ('spark','databricks') else ['_fivetran_date'], - file_format='parquet', + file_format='delta', on_schema_change='fail' ) }} diff --git a/models/salesforce_history/staging/stg_salesforce__contact_history.sql b/models/salesforce_history/staging/stg_salesforce__contact_history.sql index 68b63b70..0e679ff2 100644 --- a/models/salesforce_history/staging/stg_salesforce__contact_history.sql +++ b/models/salesforce_history/staging/stg_salesforce__contact_history.sql @@ -7,7 +7,7 @@ "field": "_fivetran_date", "data_type": "date" } if target.type not in ('spark','databricks') else ['_fivetran_date'], - file_format='parquet', + file_format='delta', on_schema_change='fail' ) }} diff --git a/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql b/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql index 75ea4d55..695238a2 100644 --- a/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql +++ b/models/salesforce_history/staging/stg_salesforce__opportunity_history.sql @@ -7,7 +7,7 @@ "field": "_fivetran_date", "data_type": "date" } if target.type not in ('spark','databricks') else ['_fivetran_date'], - file_format='parquet', + file_format='delta', on_schema_change='fail' ) }}