From 1c614b6f46a4193e97616c8d956c16568417c6e6 Mon Sep 17 00:00:00 2001 From: Mike Gouline <1960272+gouline@users.noreply.github.com> Date: Sat, 12 Oct 2024 13:49:05 +1100 Subject: [PATCH] fix: exposure parsing with aliased model --- dbtmetabase/_exposures.py | 2 +- sandbox/metabase/metabase.db.mv.db | Bin 258048 -> 274432 bytes sandbox/models/payments.sql | 3 + sandbox/models/schema.yml | 26 + tests/fixtures/api/card/27.json | 4 +- tests/fixtures/api/card/28.json | 4 +- tests/fixtures/api/card/29.json | 4 +- tests/fixtures/api/card/30.json | 4 +- tests/fixtures/api/card/31.json | 4 +- tests/fixtures/api/card/32.json | 4 +- tests/fixtures/api/card/33.json | 210 + tests/fixtures/api/collection/root/items.json | 23 + tests/fixtures/api/dashboard/2.json | 8 +- tests/fixtures/api/database.json | 6 +- tests/fixtures/api/database/2/metadata.json | 375 +- tests/fixtures/api/table.json | 274 +- tests/fixtures/api/user/1.json | 4 +- .../exposure/collection/our_analytics.yml | 23 + tests/fixtures/exposure/default/exposures.yml | 25 + tests/fixtures/manifest-v12.json | 8285 ++++++++++------- tests/test_exposures.py | 23 - tests/test_manifest.py | 32 + tests/test_models.py | 35 +- 23 files changed, 5731 insertions(+), 3647 deletions(-) create mode 100644 sandbox/models/payments.sql create mode 100644 tests/fixtures/api/card/33.json diff --git a/dbtmetabase/_exposures.py b/dbtmetabase/_exposures.py index f4c5bbdd..c04b20c2 100644 --- a/dbtmetabase/_exposures.py +++ b/dbtmetabase/_exposures.py @@ -79,7 +79,7 @@ def extract_exposures( models = self.manifest.read_models() ctx = self.__Context( - model_refs={m.name.lower(): m.ref for m in models if m.ref}, + model_refs={m.alias.lower(): m.ref for m in models if m.ref}, table_names={t["id"]: t["name"] for t in self.metabase.get_tables()}, ) diff --git a/sandbox/metabase/metabase.db.mv.db b/sandbox/metabase/metabase.db.mv.db index d642d7c5795561dc8bf4ba3648f7ce721895a773..123cfabe9d125f07a0aa5a476ff6b3f457ac5faf 100644 GIT bin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{^o~3ci0T{vPH#6{~olx9T46@TLl{q2>E*J9FrKc` z?@eUvX=Wb5#d-k=Cc-SR zju6t!Dq<2*QSoY6maSoMtcJtV=@1=O^Fef2#cApL#M21TVKpA2!z!*w(~TI?Y6N75 zRfO!YijW;v@#A#H&k2)k{Q<-uM*;DH!H-ATJ8k*_lkA;JwDAdi09^-8ok08xC@3Ms zJqbzNQ$>h-5|X&5ieqyk+Qk=OEfPrHQ^f@ulDsF;B=4!>x!u4ddv^t6{3LKq6XT~C zdv_b5m%V!c_c;}1o6CWClWu+*1wI3uiVB@(u-)4^dcllFG7;^A|y#KLP&Zse$mT5 zT#Wl(jIs}xp`e!-`|usy_fnF57}<*6`ZE%mF+6}IVnawGHiRT%Lr5Yvgd}1^NFp|b zBw|BIA~u91VnawGHiRT%Lr5Yvgd}1^NFp|b5s28}BFR!Cwln^Vm!+nIb-#fATF)2* zeepIG|L;!O+o|_UAF@Z-xBvI2?05iUhbs*l)=kk+-K1hn+oS^CJ_GS 1\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1152,7 +1324,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.7876441, + "created_at": 1728697972.8776078, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1167,13 +1339,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.customers" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_customers_customer_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbtmetabase\".\"public\".\"customers\"\nwhere customer_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1239,7 +1416,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.788374, + "created_at": 1728697972.878282, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1254,13 +1431,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_unique" + "macro.dbt.test_unique", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/unique_orders_order_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbtmetabase\".\"public\".\"orders\"\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, @@ -1326,7 +1508,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.789079, + "created_at": 1728697972.878919, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1341,13 +1523,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_order_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere order_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1413,7 +1600,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.7897742, + "created_at": 1728697972.879531, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1428,13 +1615,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_customer_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere customer_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1502,7 +1694,7 @@ "unrendered_config": { "alias": "accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758" }, - "created_at": 1718342580.7904375, + "created_at": 1728697972.880168, "relation_name": null, "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758\") }}", "language": "sql", @@ -1524,7 +1716,11 @@ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/accepted_values_orders_1ce6ab157c285f7cd2ac656013faf758.sql", + "compiled": true, + "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbtmetabase\".\"public\".\"orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1597,7 +1793,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.800781, + "created_at": 1728697972.8879502, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1612,13 +1808,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_amount.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect amount\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere amount is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1684,7 +1885,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8014944, + "created_at": 1728697972.8885949, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1699,13 +1900,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_credit_card_amount.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect credit_card_amount\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere credit_card_amount is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1771,7 +1977,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8021913, + "created_at": 1728697972.889214, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1786,13 +1992,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_coupon_amount.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect coupon_amount\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere coupon_amount is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1858,7 +2069,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8028505, + "created_at": 1728697972.889819, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1873,13 +2084,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_bank_transfer_amount.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect bank_transfer_amount\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere bank_transfer_amount is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1945,7 +2161,7 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.803492, + "created_at": 1728697972.8904269, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", @@ -1960,13 +2176,18 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ "model.sandbox.orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_orders_gift_card_amount.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect gift_card_amount\nfrom \"dbtmetabase\".\"public\".\"orders\"\nwhere gift_card_amount is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, @@ -1984,21 +2205,20 @@ "namespace": null } }, - "test.sandbox.unique_stg_customers_customer_id.c7614daada": { + "test.sandbox.unique_payments_payment_id.a01e74ab12": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "unique_stg_customers_customer_id", + "name": "unique_payments_payment_id", "resource_type": "test", "package_name": "sandbox", - "path": "unique_stg_customers_customer_id.sql", - "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.unique_stg_customers_customer_id.c7614daada", + "path": "unique_payments_payment_id.sql", + "original_file_path": "models/schema.yml", + "unique_id": "test.sandbox.unique_payments_payment_id.a01e74ab12", "fqn": [ "sandbox", - "staging", - "unique_stg_customers_customer_id" + "unique_payments_payment_id" ], - "alias": "unique_stg_customers_customer_id", + "alias": "unique_payments_payment_id", "checksum": { "name": "none", "checksum": "" @@ -2033,13 +2253,13 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.806266, + "created_at": 1728697972.8911061, "relation_name": null, "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_customers", + "name": "payments", "package": null, "version": null } @@ -2048,45 +2268,49 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_unique" + "macro.dbt.test_unique", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_customers" + "model.sandbox.payments" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/unique_payments_payment_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbtmetabase\".\"public\".\"transactions\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, "checksum": null }, - "column_name": "customer_id", - "file_key_name": "models.stg_customers", - "attached_node": "model.sandbox.stg_customers", + "column_name": "payment_id", + "file_key_name": "models.payments", + "attached_node": "model.sandbox.payments", "test_metadata": { "name": "unique", "kwargs": { - "column_name": "customer_id", - "model": "{{ get_where_subquery(ref('stg_customers')) }}" + "column_name": "payment_id", + "model": "{{ get_where_subquery(ref('payments')) }}" }, "namespace": null } }, - "test.sandbox.not_null_stg_customers_customer_id.e2cfb1f9aa": { + "test.sandbox.not_null_payments_payment_id.581e6708cd": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "not_null_stg_customers_customer_id", + "name": "not_null_payments_payment_id", "resource_type": "test", "package_name": "sandbox", - "path": "not_null_stg_customers_customer_id.sql", - "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.not_null_stg_customers_customer_id.e2cfb1f9aa", + "path": "not_null_payments_payment_id.sql", + "original_file_path": "models/schema.yml", + "unique_id": "test.sandbox.not_null_payments_payment_id.581e6708cd", "fqn": [ "sandbox", - "staging", - "not_null_stg_customers_customer_id" + "not_null_payments_payment_id" ], - "alias": "not_null_stg_customers_customer_id", + "alias": "not_null_payments_payment_id", "checksum": { "name": "none", "checksum": "" @@ -2121,13 +2345,13 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8069677, + "created_at": 1728697972.8917298, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_customers", + "name": "payments", "package": null, "version": null } @@ -2136,52 +2360,56 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_customers" + "model.sandbox.payments" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_payments_payment_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbtmetabase\".\"public\".\"transactions\"\nwhere payment_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, "checksum": null }, - "column_name": "customer_id", - "file_key_name": "models.stg_customers", - "attached_node": "model.sandbox.stg_customers", + "column_name": "payment_id", + "file_key_name": "models.payments", + "attached_node": "model.sandbox.payments", "test_metadata": { "name": "not_null", "kwargs": { - "column_name": "customer_id", - "model": "{{ get_where_subquery(ref('stg_customers')) }}" + "column_name": "payment_id", + "model": "{{ get_where_subquery(ref('payments')) }}" }, "namespace": null } }, - "test.sandbox.unique_stg_orders_order_id.e3b841c71a": { + "test.sandbox.accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.7da71fe81b": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "unique_stg_orders_order_id", + "name": "accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", "resource_type": "test", "package_name": "sandbox", - "path": "unique_stg_orders_order_id.sql", - "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.unique_stg_orders_order_id.e3b841c71a", + "path": "accepted_values_payments_ac873789575b592cd7506fd5911f7dc8.sql", + "original_file_path": "models/schema.yml", + "unique_id": "test.sandbox.accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.7da71fe81b", "fqn": [ "sandbox", - "staging", - "unique_stg_orders_order_id" + "accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card" ], - "alias": "unique_stg_orders_order_id", + "alias": "accepted_values_payments_ac873789575b592cd7506fd5911f7dc8", "checksum": { "name": "none", "checksum": "" }, "config": { "enabled": true, - "alias": null, + "alias": "accepted_values_payments_ac873789575b592cd7506fd5911f7dc8", "schema": "dbt_test__audit", "database": null, "tags": [], @@ -2208,14 +2436,16 @@ }, "patch_path": null, "build_path": null, - "unrendered_config": {}, - "created_at": 1718342580.807811, + "unrendered_config": { + "alias": "accepted_values_payments_ac873789575b592cd7506fd5911f7dc8" + }, + "created_at": 1728697972.89236, "relation_name": null, - "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", + "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_payments_ac873789575b592cd7506fd5911f7dc8\") }}", "language": "sql", "refs": [ { - "name": "stg_orders", + "name": "payments", "package": null, "version": null } @@ -2224,45 +2454,55 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_unique" + "macro.dbt.test_accepted_values", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_orders" + "model.sandbox.payments" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/accepted_values_payments_ac873789575b592cd7506fd5911f7dc8.sql", + "compiled": true, + "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbtmetabase\".\"public\".\"transactions\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\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_orders", - "attached_node": "model.sandbox.stg_orders", + "column_name": "payment_method", + "file_key_name": "models.payments", + "attached_node": "model.sandbox.payments", "test_metadata": { - "name": "unique", + "name": "accepted_values", "kwargs": { - "column_name": "order_id", - "model": "{{ get_where_subquery(ref('stg_orders')) }}" + "values": [ + "credit_card", + "coupon", + "bank_transfer", + "gift_card" + ], + "column_name": "payment_method", + "model": "{{ get_where_subquery(ref('payments')) }}" }, "namespace": null } }, - "test.sandbox.not_null_stg_orders_order_id.81cfe2fe64": { + "test.sandbox.not_null_payments_order_id.24258dbcca": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "not_null_stg_orders_order_id", + "name": "not_null_payments_order_id", "resource_type": "test", "package_name": "sandbox", - "path": "not_null_stg_orders_order_id.sql", - "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.not_null_stg_orders_order_id.81cfe2fe64", + "path": "not_null_payments_order_id.sql", + "original_file_path": "models/schema.yml", + "unique_id": "test.sandbox.not_null_payments_order_id.24258dbcca", "fqn": [ "sandbox", - "staging", - "not_null_stg_orders_order_id" + "not_null_payments_order_id" ], - "alias": "not_null_stg_orders_order_id", + "alias": "not_null_payments_order_id", "checksum": { "name": "none", "checksum": "" @@ -2297,13 +2537,13 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.837896, + "created_at": 1728697972.894464, "relation_name": null, "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_orders", + "name": "payments", "package": null, "version": null } @@ -2312,52 +2552,57 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_orders" + "model.sandbox.payments" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/schema.yml/not_null_payments_order_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbtmetabase\".\"public\".\"transactions\"\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_orders", - "attached_node": "model.sandbox.stg_orders", + "file_key_name": "models.payments", + "attached_node": "model.sandbox.payments", "test_metadata": { "name": "not_null", "kwargs": { "column_name": "order_id", - "model": "{{ get_where_subquery(ref('stg_orders')) }}" + "model": "{{ get_where_subquery(ref('payments')) }}" }, "namespace": null } }, - "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": { + "test.sandbox.unique_stg_customers_customer_id.c7614daada": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", + "name": "unique_stg_customers_customer_id", "resource_type": "test", "package_name": "sandbox", - "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", + "path": "unique_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", + "unique_id": "test.sandbox.unique_stg_customers_customer_id.c7614daada", "fqn": [ "sandbox", "staging", - "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned" + "unique_stg_customers_customer_id" ], - "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", + "alias": "unique_stg_customers_customer_id", "checksum": { "name": "none", "checksum": "" }, "config": { "enabled": true, - "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", + "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], @@ -2384,16 +2629,14 @@ }, "patch_path": null, "build_path": null, - "unrendered_config": { - "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58" - }, - "created_at": 1718342580.8387535, + "unrendered_config": {}, + "created_at": 1728697972.896523, "relation_name": null, - "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", + "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_orders", + "name": "stg_customers", "package": null, "version": null } @@ -2402,53 +2645,50 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_accepted_values", + "macro.dbt.test_unique", "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_orders" + "model.sandbox.stg_customers" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/unique_stg_customers_customer_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\nselect\n customer_id as unique_field,\n count(*) as n_records\n\nfrom \"dbtmetabase\".\"public\".\"stg_customers\"\nwhere customer_id is not null\ngroup by customer_id\nhaving count(*) > 1\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, "checksum": null }, - "column_name": "status", - "file_key_name": "models.stg_orders", - "attached_node": "model.sandbox.stg_orders", + "column_name": "customer_id", + "file_key_name": "models.stg_customers", + "attached_node": "model.sandbox.stg_customers", "test_metadata": { - "name": "accepted_values", + "name": "unique", "kwargs": { - "values": [ - "placed", - "shipped", - "completed", - "return_pending", - "returned" - ], - "column_name": "status", - "model": "{{ get_where_subquery(ref('stg_orders')) }}" + "column_name": "customer_id", + "model": "{{ get_where_subquery(ref('stg_customers')) }}" }, "namespace": null } }, - "test.sandbox.unique_stg_payments_payment_id.3744510712": { + "test.sandbox.not_null_stg_customers_customer_id.e2cfb1f9aa": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "unique_stg_payments_payment_id", + "name": "not_null_stg_customers_customer_id", "resource_type": "test", "package_name": "sandbox", - "path": "unique_stg_payments_payment_id.sql", + "path": "not_null_stg_customers_customer_id.sql", "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.unique_stg_payments_payment_id.3744510712", + "unique_id": "test.sandbox.not_null_stg_customers_customer_id.e2cfb1f9aa", "fqn": [ "sandbox", "staging", - "unique_stg_payments_payment_id" + "not_null_stg_customers_customer_id" ], - "alias": "unique_stg_payments_payment_id", + "alias": "not_null_stg_customers_customer_id", "checksum": { "name": "none", "checksum": "" @@ -2483,13 +2723,13 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8411777, + "created_at": 1728697972.897233, "relation_name": null, - "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", + "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_payments", + "name": "stg_customers", "package": null, "version": null } @@ -2498,45 +2738,50 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_unique" + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_payments" + "model.sandbox.stg_customers" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/not_null_stg_customers_customer_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect customer_id\nfrom \"dbtmetabase\".\"public\".\"stg_customers\"\nwhere customer_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, "checksum": null }, - "column_name": "payment_id", - "file_key_name": "models.stg_payments", - "attached_node": "model.sandbox.stg_payments", + "column_name": "customer_id", + "file_key_name": "models.stg_customers", + "attached_node": "model.sandbox.stg_customers", "test_metadata": { - "name": "unique", + "name": "not_null", "kwargs": { - "column_name": "payment_id", - "model": "{{ get_where_subquery(ref('stg_payments')) }}" + "column_name": "customer_id", + "model": "{{ get_where_subquery(ref('stg_customers')) }}" }, "namespace": null } }, - "test.sandbox.not_null_stg_payments_payment_id.c19cc50075": { + "test.sandbox.unique_stg_orders_order_id.e3b841c71a": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "not_null_stg_payments_payment_id", + "name": "unique_stg_orders_order_id", "resource_type": "test", "package_name": "sandbox", - "path": "not_null_stg_payments_payment_id.sql", + "path": "unique_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.not_null_stg_payments_payment_id.c19cc50075", + "unique_id": "test.sandbox.unique_stg_orders_order_id.e3b841c71a", "fqn": [ "sandbox", "staging", - "not_null_stg_payments_payment_id" + "unique_stg_orders_order_id" ], - "alias": "not_null_stg_payments_payment_id", + "alias": "unique_stg_orders_order_id", "checksum": { "name": "none", "checksum": "" @@ -2571,13 +2816,13 @@ "patch_path": null, "build_path": null, "unrendered_config": {}, - "created_at": 1718342580.8418767, + "created_at": 1728697972.8980212, "relation_name": null, - "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_payments", + "name": "stg_orders", "package": null, "version": null } @@ -2586,52 +2831,57 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_not_null" + "macro.dbt.test_unique", + "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_payments" + "model.sandbox.stg_orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/unique_stg_orders_order_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\nselect\n order_id as unique_field,\n count(*) as n_records\n\nfrom \"dbtmetabase\".\"public\".\"stg_orders\"\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": "payment_id", - "file_key_name": "models.stg_payments", - "attached_node": "model.sandbox.stg_payments", + "column_name": "order_id", + "file_key_name": "models.stg_orders", + "attached_node": "model.sandbox.stg_orders", "test_metadata": { - "name": "not_null", + "name": "unique", "kwargs": { - "column_name": "payment_id", - "model": "{{ get_where_subquery(ref('stg_payments')) }}" + "column_name": "order_id", + "model": "{{ get_where_subquery(ref('stg_orders')) }}" }, "namespace": null } }, - "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": { + "test.sandbox.not_null_stg_orders_order_id.81cfe2fe64": { "database": "dbtmetabase", "schema": "public_dbt_test__audit", - "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", + "name": "not_null_stg_orders_order_id", "resource_type": "test", "package_name": "sandbox", - "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", + "path": "not_null_stg_orders_order_id.sql", "original_file_path": "models/staging/schema.yml", - "unique_id": "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", + "unique_id": "test.sandbox.not_null_stg_orders_order_id.81cfe2fe64", "fqn": [ "sandbox", "staging", - "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card" + "not_null_stg_orders_order_id" ], - "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", + "alias": "not_null_stg_orders_order_id", "checksum": { "name": "none", "checksum": "" }, "config": { "enabled": true, - "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", + "alias": null, "schema": "dbt_test__audit", "database": null, "tags": [], @@ -2658,16 +2908,14 @@ }, "patch_path": null, "build_path": null, - "unrendered_config": { - "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef" - }, - "created_at": 1718342580.8425684, + "unrendered_config": {}, + "created_at": 1728697972.8986309, "relation_name": null, - "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", + "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", "language": "sql", "refs": [ { - "name": "stg_payments", + "name": "stg_orders", "package": null, "version": null } @@ -2676,69 +2924,456 @@ "metrics": [], "depends_on": { "macros": [ - "macro.dbt.test_accepted_values", + "macro.dbt.test_not_null", "macro.dbt.get_where_subquery" ], "nodes": [ - "model.sandbox.stg_payments" + "model.sandbox.stg_orders" ] }, - "compiled_path": null, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/not_null_stg_orders_order_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect order_id\nfrom \"dbtmetabase\".\"public\".\"stg_orders\"\nwhere order_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], "contract": { "enforced": false, "alias_types": true, "checksum": null }, - "column_name": "payment_method", - "file_key_name": "models.stg_payments", - "attached_node": "model.sandbox.stg_payments", + "column_name": "order_id", + "file_key_name": "models.stg_orders", + "attached_node": "model.sandbox.stg_orders", "test_metadata": { - "name": "accepted_values", + "name": "not_null", "kwargs": { - "values": [ - "credit_card", - "coupon", - "bank_transfer", - "gift_card" - ], - "column_name": "payment_method", - "model": "{{ get_where_subquery(ref('stg_payments')) }}" + "column_name": "order_id", + "model": "{{ get_where_subquery(ref('stg_orders')) }}" }, "namespace": null } - } - }, - "sources": {}, - "macros": { - "macro.dbt_postgres.postgres__current_timestamp": { - "name": "postgres__current_timestamp", - "resource_type": "macro", - "package_name": "dbt_postgres", - "path": "macros/timestamps.sql", - "original_file_path": "macros/timestamps.sql", - "unique_id": "macro.dbt_postgres.postgres__current_timestamp", - "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", - "depends_on": { - "macros": [] + }, + "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": { + "database": "dbtmetabase", + "schema": "public_dbt_test__audit", + "name": "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned", + "resource_type": "test", + "package_name": "sandbox", + "path": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", + "original_file_path": "models/staging/schema.yml", + "unique_id": "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", + "fqn": [ + "sandbox", + "staging", + "accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned" + ], + "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", + "checksum": { + "name": "none", + "checksum": "" + }, + "config": { + "enabled": true, + "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58", + "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, - "arguments": [], - "created_at": 1718342580.281623, - "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", + "build_path": null, + "unrendered_config": { + "alias": "accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58" + }, + "created_at": 1728697972.899276, + "relation_name": null, + "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58\") }}", + "language": "sql", + "refs": [ + { + "name": "stg_orders", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "depends_on": { + "macros": [ + "macro.dbt.test_accepted_values", + "macro.dbt.get_where_subquery" + ], + "nodes": [ + "model.sandbox.stg_orders" + ] + }, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/accepted_values_stg_orders_4f514bf94b77b7ea437830eec4421c58.sql", + "compiled": true, + "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n status as value_field,\n count(*) as n_records\n\n from \"dbtmetabase\".\"public\".\"stg_orders\"\n group by status\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'placed','shipped','completed','return_pending','returned'\n)\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "contract": { + "enforced": false, + "alias_types": true, + "checksum": null + }, + "column_name": "status", + "file_key_name": "models.stg_orders", + "attached_node": "model.sandbox.stg_orders", + "test_metadata": { + "name": "accepted_values", + "kwargs": { + "values": [ + "placed", + "shipped", + "completed", + "return_pending", + "returned" + ], + "column_name": "status", + "model": "{{ get_where_subquery(ref('stg_orders')) }}" + }, + "namespace": null + } + }, + "test.sandbox.unique_stg_payments_payment_id.3744510712": { + "database": "dbtmetabase", + "schema": "public_dbt_test__audit", + "name": "unique_stg_payments_payment_id", + "resource_type": "test", + "package_name": "sandbox", + "path": "unique_stg_payments_payment_id.sql", + "original_file_path": "models/staging/schema.yml", + "unique_id": "test.sandbox.unique_stg_payments_payment_id.3744510712", + "fqn": [ + "sandbox", + "staging", + "unique_stg_payments_payment_id" + ], + "alias": "unique_stg_payments_payment_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": 1728697972.9008808, + "relation_name": null, + "raw_code": "{{ test_unique(**_dbt_generic_test_kwargs) }}", + "language": "sql", + "refs": [ + { + "name": "stg_payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "depends_on": { + "macros": [ + "macro.dbt.test_unique", + "macro.dbt.get_where_subquery" + ], + "nodes": [ + "model.sandbox.stg_payments" + ] + }, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/unique_stg_payments_payment_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\nselect\n payment_id as unique_field,\n count(*) as n_records\n\nfrom \"dbtmetabase\".\"public\".\"stg_payments\"\nwhere payment_id is not null\ngroup by payment_id\nhaving count(*) > 1\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "contract": { + "enforced": false, + "alias_types": true, + "checksum": null + }, + "column_name": "payment_id", + "file_key_name": "models.stg_payments", + "attached_node": "model.sandbox.stg_payments", + "test_metadata": { + "name": "unique", + "kwargs": { + "column_name": "payment_id", + "model": "{{ get_where_subquery(ref('stg_payments')) }}" + }, + "namespace": null + } + }, + "test.sandbox.not_null_stg_payments_payment_id.c19cc50075": { + "database": "dbtmetabase", + "schema": "public_dbt_test__audit", + "name": "not_null_stg_payments_payment_id", + "resource_type": "test", + "package_name": "sandbox", + "path": "not_null_stg_payments_payment_id.sql", + "original_file_path": "models/staging/schema.yml", + "unique_id": "test.sandbox.not_null_stg_payments_payment_id.c19cc50075", + "fqn": [ + "sandbox", + "staging", + "not_null_stg_payments_payment_id" + ], + "alias": "not_null_stg_payments_payment_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": 1728697972.901458, + "relation_name": null, + "raw_code": "{{ test_not_null(**_dbt_generic_test_kwargs) }}", + "language": "sql", + "refs": [ + { + "name": "stg_payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "depends_on": { + "macros": [ + "macro.dbt.test_not_null", + "macro.dbt.get_where_subquery" + ], + "nodes": [ + "model.sandbox.stg_payments" + ] + }, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/not_null_stg_payments_payment_id.sql", + "compiled": true, + "compiled_code": "\n \n \n\n\n\nselect payment_id\nfrom \"dbtmetabase\".\"public\".\"stg_payments\"\nwhere payment_id is null\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "contract": { + "enforced": false, + "alias_types": true, + "checksum": null + }, + "column_name": "payment_id", + "file_key_name": "models.stg_payments", + "attached_node": "model.sandbox.stg_payments", + "test_metadata": { + "name": "not_null", + "kwargs": { + "column_name": "payment_id", + "model": "{{ get_where_subquery(ref('stg_payments')) }}" + }, + "namespace": null + } + }, + "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": { + "database": "dbtmetabase", + "schema": "public_dbt_test__audit", + "name": "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card", + "resource_type": "test", + "package_name": "sandbox", + "path": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", + "original_file_path": "models/staging/schema.yml", + "unique_id": "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", + "fqn": [ + "sandbox", + "staging", + "accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card" + ], + "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", + "checksum": { + "name": "none", + "checksum": "" + }, + "config": { + "enabled": true, + "alias": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef", + "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": "accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef" + }, + "created_at": 1728697972.902038, + "relation_name": null, + "raw_code": "{{ test_accepted_values(**_dbt_generic_test_kwargs) }}{{ config(alias=\"accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef\") }}", + "language": "sql", + "refs": [ + { + "name": "stg_payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "depends_on": { + "macros": [ + "macro.dbt.test_accepted_values", + "macro.dbt.get_where_subquery" + ], + "nodes": [ + "model.sandbox.stg_payments" + ] + }, + "compiled_path": "target/compiled/sandbox/models/staging/schema.yml/accepted_values_stg_payments_c7909fb19b1f0177c2bf99c7912f06ef.sql", + "compiled": true, + "compiled_code": "\n \n \n\nwith all_values as (\n\n select\n payment_method as value_field,\n count(*) as n_records\n\n from \"dbtmetabase\".\"public\".\"stg_payments\"\n group by payment_method\n\n)\n\nselect *\nfrom all_values\nwhere value_field not in (\n 'credit_card','coupon','bank_transfer','gift_card'\n)\n\n\n", + "extra_ctes_injected": true, + "extra_ctes": [], + "contract": { + "enforced": false, + "alias_types": true, + "checksum": null + }, + "column_name": "payment_method", + "file_key_name": "models.stg_payments", + "attached_node": "model.sandbox.stg_payments", + "test_metadata": { + "name": "accepted_values", + "kwargs": { + "values": [ + "credit_card", + "coupon", + "bank_transfer", + "gift_card" + ], + "column_name": "payment_method", + "model": "{{ get_where_subquery(ref('stg_payments')) }}" + }, + "namespace": null + } + } + }, + "sources": {}, + "macros": { + "macro.dbt_postgres.postgres__current_timestamp": { + "name": "postgres__current_timestamp", + "resource_type": "macro", + "package_name": "dbt_postgres", + "path": "macros/timestamps.sql", + "original_file_path": "macros/timestamps.sql", + "unique_id": "macro.dbt_postgres.postgres__current_timestamp", + "macro_sql": "{% macro postgres__current_timestamp() -%}\n now()\n{%- endmacro %}", + "depends_on": { + "macros": [] + }, + "description": "", + "meta": {}, + "docs": { + "show": true, + "node_color": null + }, + "patch_path": null, + "arguments": [], + "created_at": 1728697972.4873111, + "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": [] @@ -2751,7 +3386,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2818005, + "created_at": 1728697972.487473, "supported_languages": null }, "macro.dbt_postgres.postgres__snapshot_get_time": { @@ -2775,7 +3410,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.281886, + "created_at": 1728697972.487547, "supported_languages": null }, "macro.dbt_postgres.postgres__current_timestamp_backcompat": { @@ -2799,7 +3434,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2819638, + "created_at": 1728697972.487625, "supported_languages": null }, "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat": { @@ -2823,7 +3458,103 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2820435, + "created_at": 1728697972.487694, + "supported_languages": null + }, + "macro.dbt_postgres.postgres__get_catalog_relations": { + "name": "postgres__get_catalog_relations", + "resource_type": "macro", + "package_name": "dbt_postgres", + "path": "macros/catalog.sql", + "original_file_path": "macros/catalog.sql", + "unique_id": "macro.dbt_postgres.postgres__get_catalog_relations", + "macro_sql": "{% macro postgres__get_catalog_relations(information_schema, relations) -%}\n {%- call statement('catalog', fetch_result=True) -%}\n\n {#\n If the user has multiple databases set and the first one is wrong, this will fail.\n But we won't fail in the case where there are multiple quoting-difference-only dbs, which is better.\n #}\n {% set database = information_schema.database %}\n {{ adapter.verify_database(database) }}\n\n select\n '{{ database }}' as table_database,\n sch.nspname as table_schema,\n tbl.relname as table_name,\n case tbl.relkind\n when 'v' then 'VIEW'\n when 'm' then 'MATERIALIZED VIEW'\n else 'BASE TABLE'\n end as table_type,\n tbl_desc.description as table_comment,\n col.attname as column_name,\n col.attnum as column_index,\n pg_catalog.format_type(col.atttypid, col.atttypmod) as column_type,\n col_desc.description as column_comment,\n pg_get_userbyid(tbl.relowner) as table_owner\n\n from pg_catalog.pg_namespace sch\n join pg_catalog.pg_class tbl on tbl.relnamespace = sch.oid\n join pg_catalog.pg_attribute col on col.attrelid = tbl.oid\n left outer join pg_catalog.pg_description tbl_desc on (tbl_desc.objoid = tbl.oid and tbl_desc.objsubid = 0)\n left outer join pg_catalog.pg_description col_desc on (col_desc.objoid = tbl.oid and col_desc.objsubid = col.attnum)\n where (\n {%- for relation in relations -%}\n {%- if relation.identifier -%}\n (upper(sch.nspname) = upper('{{ relation.schema }}') and\n upper(tbl.relname) = upper('{{ relation.identifier }}'))\n {%- else-%}\n upper(sch.nspname) = upper('{{ relation.schema }}')\n {%- endif -%}\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n )\n and not pg_is_other_temp_schema(sch.oid) -- not a temporary schema belonging to another session\n and tbl.relpersistence in ('p', 'u') -- [p]ermanent table or [u]nlogged table. Exclude [t]emporary tables\n and tbl.relkind in ('r', 'v', 'f', 'p', 'm') -- o[r]dinary table, [v]iew, [f]oreign table, [p]artitioned table, [m]aterialized view. Other values are [i]ndex, [S]equence, [c]omposite type, [t]OAST table\n and col.attnum > 0 -- negative numbers are used for system columns such as oid\n and not col.attisdropped -- column as not been dropped\n\n order by\n sch.nspname,\n tbl.relname,\n col.attnum\n\n {%- endcall -%}\n\n {{ return(load_result('catalog').table) }}\n{%- endmacro %}", + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "meta": {}, + "docs": { + "show": true, + "node_color": null + }, + "patch_path": null, + "arguments": [], + "created_at": 1728697972.488611, + "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": 1728697972.488807, + "supported_languages": null + }, + "macro.dbt_postgres.postgres__get_relations": { + "name": "postgres__get_relations", + "resource_type": "macro", + "package_name": "dbt_postgres", + "path": "macros/relations.sql", + "original_file_path": "macros/relations.sql", + "unique_id": "macro.dbt_postgres.postgres__get_relations", + "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v', 'm')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", + "depends_on": { + "macros": [ + "macro.dbt.statement" + ] + }, + "description": "", + "meta": {}, + "docs": { + "show": true, + "node_color": null + }, + "patch_path": null, + "arguments": [], + "created_at": 1728697972.4892192, + "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": 1728697972.489287, "supported_languages": null }, "macro.dbt_postgres.postgres__create_table_as": { @@ -2850,7 +3581,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2895832, + "created_at": 1728697972.4949372, "supported_languages": null }, "macro.dbt_postgres.postgres__get_create_index_sql": { @@ -2872,7 +3603,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2900841, + "created_at": 1728697972.495283, "supported_languages": null }, "macro.dbt_postgres.postgres__create_schema": { @@ -2896,7 +3627,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2903237, + "created_at": 1728697972.4954722, "supported_languages": null }, "macro.dbt_postgres.postgres__drop_schema": { @@ -2920,7 +3651,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.290559, + "created_at": 1728697972.495651, "supported_languages": null }, "macro.dbt_postgres.postgres__get_columns_in_relation": { @@ -2945,7 +3676,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2908957, + "created_at": 1728697972.495915, "supported_languages": null }, "macro.dbt_postgres.postgres__list_relations_without_caching": { @@ -2969,7 +3700,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2911997, + "created_at": 1728697972.4961438, "supported_languages": null }, "macro.dbt_postgres.postgres__information_schema_name": { @@ -2991,7 +3722,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2913172, + "created_at": 1728697972.496236, "supported_languages": null }, "macro.dbt_postgres.postgres__list_schemas": { @@ -3015,7 +3746,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2916827, + "created_at": 1728697972.496414, "supported_languages": null }, "macro.dbt_postgres.postgres__check_schema_exists": { @@ -3039,7 +3770,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2919967, + "created_at": 1728697972.496613, "supported_languages": null }, "macro.dbt_postgres.postgres__make_relation_with_suffix": { @@ -3061,7 +3792,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2926402, + "created_at": 1728697972.497076, "supported_languages": null }, "macro.dbt_postgres.postgres__make_intermediate_relation": { @@ -3085,7 +3816,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2927878, + "created_at": 1728697972.497238, "supported_languages": null }, "macro.dbt_postgres.postgres__make_temp_relation": { @@ -3109,7 +3840,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2930126, + "created_at": 1728697972.497503, "supported_languages": null }, "macro.dbt_postgres.postgres__make_backup_relation": { @@ -3133,7 +3864,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.293217, + "created_at": 1728697972.4976609, "supported_languages": null }, "macro.dbt_postgres.postgres_escape_comment": { @@ -3155,7 +3886,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.293546, + "created_at": 1728697972.497921, "supported_languages": null }, "macro.dbt_postgres.postgres__alter_relation_comment": { @@ -3179,7 +3910,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2937047, + "created_at": 1728697972.498045, "supported_languages": null }, "macro.dbt_postgres.postgres__alter_column_comment": { @@ -3203,7 +3934,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.294156, + "created_at": 1728697972.498358, "supported_languages": null }, "macro.dbt_postgres.postgres__get_show_grant_sql": { @@ -3225,7 +3956,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2943137, + "created_at": 1728697972.498471, "supported_languages": null }, "macro.dbt_postgres.postgres__copy_grants": { @@ -3247,7 +3978,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2943985, + "created_at": 1728697972.498537, "supported_languages": null }, "macro.dbt_postgres.postgres__get_show_indexes_sql": { @@ -3269,7 +4000,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.294567, + "created_at": 1728697972.498639, "supported_languages": null }, "macro.dbt_postgres.postgres__get_drop_index_sql": { @@ -3291,21 +4022,66 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2946677, + "created_at": 1728697972.498715, + "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": 1728697972.4989178, + "supported_languages": null + }, + "macro.dbt_postgres.postgres__snapshot_merge_sql": { + "name": "postgres__snapshot_merge_sql", + "resource_type": "macro", + "package_name": "dbt_postgres", + "path": "macros/materializations/snapshot_merge.sql", + "original_file_path": "macros/materializations/snapshot_merge.sql", + "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", + "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", + "depends_on": { + "macros": [] + }, + "description": "", + "meta": {}, + "docs": { + "show": true, + "node_color": null + }, + "patch_path": null, + "arguments": [], + "created_at": 1728697972.499317, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_catalog_relations": { - "name": "postgres__get_catalog_relations", + "macro.dbt_postgres.postgres__drop_materialized_view": { + "name": "postgres__drop_materialized_view", "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 %}", + "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": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3315,20 +4091,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.295994, + "created_at": 1728697972.499397, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_catalog": { - "name": "postgres__get_catalog", + "macro.dbt_postgres.postgres__describe_materialized_view": { + "name": "postgres__describe_materialized_view", "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 %}", + "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_postgres.postgres__get_catalog_relations" + "macro.dbt.run_query", + "macro.dbt.get_show_indexes_sql" ] }, "description": "", @@ -3339,21 +4116,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2962687, + "created_at": 1728697972.4995542, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_relations": { - "name": "postgres__get_relations", + "macro.dbt_postgres.postgres__refresh_materialized_view": { + "name": "postgres__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt_postgres", - "path": "macros/relations.sql", - "original_file_path": "macros/relations.sql", - "unique_id": "macro.dbt_postgres.postgres__get_relations", - "macro_sql": "{% macro postgres__get_relations() -%}\n\n {#\n -- in pg_depend, objid is the dependent, refobjid is the referenced object\n -- > a pg_depend entry indicates that the referenced object cannot be\n -- > dropped without also dropping the dependent object.\n #}\n\n {%- call statement('relations', fetch_result=True) -%}\n with relation as (\n select\n pg_rewrite.ev_class as class,\n pg_rewrite.oid as id\n from pg_rewrite\n ),\n class as (\n select\n oid as id,\n relname as name,\n relnamespace as schema,\n relkind as kind\n from pg_class\n ),\n dependency as (\n select distinct\n pg_depend.objid as id,\n pg_depend.refobjid as ref\n from pg_depend\n ),\n schema as (\n select\n pg_namespace.oid as id,\n pg_namespace.nspname as name\n from pg_namespace\n where nspname != 'information_schema' and nspname not like 'pg\\_%'\n ),\n referenced as (\n select\n relation.id AS id,\n referenced_class.name ,\n referenced_class.schema ,\n referenced_class.kind\n from relation\n join class as referenced_class on relation.class=referenced_class.id\n where referenced_class.kind in ('r', 'v', 'm')\n ),\n relationships as (\n select\n referenced.name as referenced_name,\n referenced.schema as referenced_schema_id,\n dependent_class.name as dependent_name,\n dependent_class.schema as dependent_schema_id,\n referenced.kind as kind\n from referenced\n join dependency on referenced.id=dependency.id\n join class as dependent_class on dependency.ref=dependent_class.id\n where\n (referenced.name != dependent_class.name or\n referenced.schema != dependent_class.schema)\n )\n\n select\n referenced_schema.name as referenced_schema,\n relationships.referenced_name as referenced_name,\n dependent_schema.name as dependent_schema,\n relationships.dependent_name as dependent_name\n from relationships\n join schema as dependent_schema on relationships.dependent_schema_id=dependent_schema.id\n join schema as referenced_schema on relationships.referenced_schema_id=referenced_schema.id\n group by referenced_schema, referenced_name, dependent_schema, dependent_name\n order by referenced_schema, referenced_name, dependent_schema, dependent_name;\n\n {%- endcall -%}\n\n {{ return(load_result('relations').table) }}\n{% endmacro %}", + "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": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3363,21 +4138,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.296919, + "created_at": 1728697972.4996312, "supported_languages": null }, - "macro.dbt_postgres.postgres_get_relations": { - "name": "postgres_get_relations", + "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.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 %}", + "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": [ - "macro.dbt_postgres.postgres__get_relations" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3387,21 +4160,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2970212, + "created_at": 1728697972.499727, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_incremental_default_sql": { - "name": "postgres__get_incremental_default_sql", + "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/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 %}", + "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_incremental_delete_insert_sql", - "macro.dbt.get_incremental_append_sql" + "macro.dbt.get_replace_sql", + "macro.dbt_postgres.postgres__update_indexes_on_materialized_view" ] }, "description": "", @@ -3412,19 +4185,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2973115, + "created_at": 1728697972.500275, "supported_languages": null }, - "macro.dbt_postgres.postgres__snapshot_merge_sql": { - "name": "postgres__snapshot_merge_sql", + "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/materializations/snapshot_merge.sql", - "original_file_path": "macros/materializations/snapshot_merge.sql", - "unique_id": "macro.dbt_postgres.postgres__snapshot_merge_sql", - "macro_sql": "{% macro postgres__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n update {{ target }}\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_scd_id::text = {{ target }}.dbt_scd_id::text\n and DBT_INTERNAL_SOURCE.dbt_change_type::text in ('update'::text, 'delete'::text)\n and {{ target }}.dbt_valid_to is null;\n\n insert into {{ target }} ({{ insert_cols_csv }})\n select {% for column in insert_cols -%}\n DBT_INTERNAL_SOURCE.{{ column }} {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n from {{ source }} as DBT_INTERNAL_SOURCE\n where DBT_INTERNAL_SOURCE.dbt_change_type::text = 'insert'::text;\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__get_drop_index_sql", + "macro.dbt_postgres.postgres__get_create_index_sql" + ] }, "description": "", "meta": {}, @@ -3434,20 +4210,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2978735, + "created_at": 1728697972.500648, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_replace_view_sql": { - "name": "postgres__get_replace_view_sql", + "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/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 %}", + "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.get_assert_columns_equivalent" + "macro.dbt_postgres.postgres__describe_materialized_view" ] }, "description": "", @@ -3458,19 +4234,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2982893, + "created_at": 1728697972.5008159, "supported_languages": null }, - "macro.dbt_postgres.postgres__drop_view": { - "name": "postgres__drop_view", + "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/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 %}", + "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": [] + "macros": [ + "macro.dbt.get_create_index_sql" + ] }, "description": "", "meta": {}, @@ -3480,17 +4258,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2983916, + "created_at": 1728697972.501068, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_rename_view_sql": { - "name": "postgres__get_rename_view_sql", + "macro.dbt_postgres.postgres__drop_table": { + "name": "postgres__drop_table", "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 %}", + "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": [] }, @@ -3502,7 +4280,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2985115, + "created_at": 1728697972.501149, "supported_languages": null }, "macro.dbt_postgres.postgres__get_replace_table_sql": { @@ -3528,17 +4306,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2992072, + "created_at": 1728697972.5015419, "supported_languages": null }, - "macro.dbt_postgres.postgres__drop_table": { - "name": "postgres__drop_table", + "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/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 %}", + "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": [] }, @@ -3550,17 +4328,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2993338, + "created_at": 1728697972.5016441, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_rename_table_sql": { - "name": "postgres__get_rename_table_sql", + "macro.dbt_postgres.postgres__drop_view": { + "name": "postgres__drop_view", "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 %}", + "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": [] }, @@ -3572,19 +4350,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.299453, + "created_at": 1728697972.5017211, "supported_languages": null }, - "macro.dbt_postgres.postgres__refresh_materialized_view": { - "name": "postgres__refresh_materialized_view", + "macro.dbt_postgres.postgres__get_replace_view_sql": { + "name": "postgres__get_replace_view_sql", "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 %}", + "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": [] + "macros": [ + "macro.dbt.get_assert_columns_equivalent" + ] }, "description": "", "meta": {}, @@ -3594,22 +4374,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2995586, + "created_at": 1728697972.502031, "supported_languages": null }, - "macro.dbt_postgres.postgres__describe_materialized_view": { - "name": "postgres__describe_materialized_view", + "macro.dbt_postgres.postgres__get_rename_view_sql": { + "name": "postgres__get_rename_view_sql", "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 %}", + "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": [ - "macro.dbt.run_query", - "macro.dbt.get_show_indexes_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3619,17 +4396,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2997808, + "created_at": 1728697972.502134, "supported_languages": null }, - "macro.dbt_postgres.postgres__drop_materialized_view": { - "name": "postgres__drop_materialized_view", + "macro.dbt_postgres.postgres__dateadd": { + "name": "postgres__dateadd", "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 %}", + "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": [] }, @@ -3641,17 +4418,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.2998881, + "created_at": 1728697972.502254, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_rename_materialized_view_sql": { - "name": "postgres__get_rename_materialized_view_sql", + "macro.dbt_postgres.postgres__listagg": { + "name": "postgres__listagg", "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 %}", + "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": [] }, @@ -3663,21 +4440,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3000157, + "created_at": 1728697972.502623, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql": { - "name": "postgres__get_alter_materialized_view_as_sql", + "macro.dbt_postgres.postgres__datediff": { + "name": "postgres__datediff", "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 %}", + "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.get_replace_sql", - "macro.dbt_postgres.postgres__update_indexes_on_materialized_view" + "macro.dbt.datediff" ] }, "description": "", @@ -3688,21 +4464,44 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3006923, + "created_at": 1728697972.504535, + "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": 1728697972.504628, "supported_languages": null }, - "macro.dbt_postgres.postgres__update_indexes_on_materialized_view": { - "name": "postgres__update_indexes_on_materialized_view", + "macro.dbt_postgres.postgres__last_day": { + "name": "postgres__last_day", "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", + "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_postgres.postgres__get_drop_index_sql", - "macro.dbt_postgres.postgres__get_create_index_sql" + "macro.dbt.dateadd", + "macro.dbt.date_trunc", + "macro.dbt.default_last_day" ] }, "description": "", @@ -3713,20 +4512,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.301095, + "created_at": 1728697972.50491, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes": { - "name": "postgres__get_materialized_view_configuration_changes", + "macro.dbt_postgres.postgres__split_part": { + "name": "postgres__split_part", "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 %}", + "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_postgres.postgres__describe_materialized_view" + "macro.dbt.default__split_part", + "macro.dbt._split_part_negative" ] }, "description": "", @@ -3737,20 +4537,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3013, + "created_at": 1728697972.5051389, "supported_languages": null }, - "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql": { - "name": "postgres__get_create_materialized_view_as_sql", + "macro.dbt.run_hooks": { + "name": "run_hooks", "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 %}", + "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.get_create_index_sql" + "macro.dbt.statement" ] }, "description": "", @@ -3761,17 +4561,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3016276, + "created_at": 1728697972.505784, "supported_languages": null }, - "macro.dbt_postgres.postgres__listagg": { - "name": "postgres__listagg", + "macro.dbt.make_hook_config": { + "name": "make_hook_config", "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 %}", + "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": [] }, @@ -3783,19 +4583,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3020928, + "created_at": 1728697972.505899, "supported_languages": null }, - "macro.dbt_postgres.postgres__dateadd": { - "name": "postgres__dateadd", + "macro.dbt.before_begin": { + "name": "before_begin", "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 %}", + "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": [] + "macros": [ + "macro.dbt.make_hook_config" + ] }, "description": "", "meta": {}, @@ -3805,19 +4607,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3022559, + "created_at": 1728697972.505981, "supported_languages": null }, - "macro.dbt_postgres.postgres__any_value": { - "name": "postgres__any_value", + "macro.dbt.in_transaction": { + "name": "in_transaction", "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 %}", + "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": [] + "macros": [ + "macro.dbt.make_hook_config" + ] }, "description": "", "meta": {}, @@ -3827,21 +4631,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.302353, + "created_at": 1728697972.506061, "supported_languages": null }, - "macro.dbt_postgres.postgres__split_part": { - "name": "postgres__split_part", + "macro.dbt.after_commit": { + "name": "after_commit", "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 %}", + "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.default__split_part", - "macro.dbt._split_part_negative" + "macro.dbt.make_hook_config" ] }, "description": "", @@ -3852,23 +4655,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3026361, + "created_at": 1728697972.506143, "supported_languages": null }, - "macro.dbt_postgres.postgres__last_day": { - "name": "postgres__last_day", + "macro.dbt.set_sql_header": { + "name": "set_sql_header", "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 %}", + "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": [ - "macro.dbt.dateadd", - "macro.dbt.date_trunc", - "macro.dbt.default_last_day" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3878,21 +4677,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3029845, + "created_at": 1728697972.5063748, "supported_languages": null }, - "macro.dbt_postgres.postgres__datediff": { - "name": "postgres__datediff", + "macro.dbt.should_full_refresh": { + "name": "should_full_refresh", "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 %}", + "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": [ - "macro.dbt.datediff" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3902,20 +4699,42 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3052852, + "created_at": 1728697972.506544, "supported_languages": null }, - "macro.dbt.generate_database_name": { - "name": "generate_database_name", + "macro.dbt.should_store_failures": { + "name": "should_store_failures", "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 %}", + "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": 1728697972.506714, + "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.default__generate_database_name" + "macro.dbt_postgres.postgres__snapshot_merge_sql" ] }, "description": "", @@ -3926,17 +4745,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3055835, + "created_at": 1728697972.506986, "supported_languages": null }, - "macro.dbt.default__generate_database_name": { - "name": "default__generate_database_name", + "macro.dbt.default__snapshot_merge_sql": { + "name": "default__snapshot_merge_sql", "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 %}", + "path": "macros/materializations/snapshots/snapshot_merge.sql", + "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", + "unique_id": "macro.dbt.default__snapshot_merge_sql", + "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target.render() }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", "depends_on": { "macros": [] }, @@ -3948,21 +4767,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3057575, + "created_at": 1728697972.507165, "supported_languages": null }, - "macro.dbt.generate_schema_name": { - "name": "generate_schema_name", + "macro.dbt.strategy_dispatch": { + "name": "strategy_dispatch", "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 %}", + "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": [ - "macro.dbt.default__generate_schema_name" - ] + "macros": [] }, "description": "", "meta": {}, @@ -3972,19 +4789,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3061469, + "created_at": 1728697972.50944, "supported_languages": null }, - "macro.dbt.default__generate_schema_name": { - "name": "default__generate_schema_name", + "macro.dbt.snapshot_hash_arguments": { + "name": "snapshot_hash_arguments", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__snapshot_hash_arguments" + ] }, "description": "", "meta": {}, @@ -3994,17 +4813,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3063257, + "created_at": 1728697972.509538, "supported_languages": null }, - "macro.dbt.generate_schema_name_for_env": { - "name": "generate_schema_name_for_env", + "macro.dbt.default__snapshot_hash_arguments": { + "name": "default__snapshot_hash_arguments", "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 %}", + "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": [] }, @@ -4016,20 +4835,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3066485, + "created_at": 1728697972.5096629, "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 %}", + "macro.dbt.snapshot_timestamp_strategy": { + "name": "snapshot_timestamp_strategy", + "resource_type": "macro", + "package_name": "dbt", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "unique_id": "macro.dbt.snapshot_timestamp_strategy", + "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.default__generate_alias_name" + "macro.dbt.snapshot_hash_arguments" ] }, "description": "", @@ -4040,19 +4859,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3071277, + "created_at": 1728697972.510057, "supported_languages": null }, - "macro.dbt.default__generate_alias_name": { - "name": "default__generate_alias_name", + "macro.dbt.snapshot_string_as_time": { + "name": "snapshot_string_as_time", "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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__snapshot_string_as_time" + ] }, "description": "", "meta": {}, @@ -4062,21 +4883,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3074532, + "created_at": 1728697972.510154, "supported_languages": null }, - "macro.dbt.resolve_model_name": { - "name": "resolve_model_name", + "macro.dbt.default__snapshot_string_as_time": { + "name": "default__snapshot_string_as_time", "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 %}", + "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": [ - "macro.dbt.default__resolve_model_name" - ] + "macros": [] }, "description": "", "meta": {}, @@ -4086,19 +4905,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.308697, + "created_at": 1728697972.510255, "supported_languages": null }, - "macro.dbt.default__resolve_model_name": { - "name": "default__resolve_model_name", + "macro.dbt.snapshot_check_all_get_existing_columns": { + "name": "snapshot_check_all_get_existing_columns", "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", + "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": [] + "macros": [ + "macro.dbt.get_columns_in_query" + ] }, "description": "", "meta": {}, @@ -4108,20 +4929,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3089085, + "created_at": 1728697972.511041, "supported_languages": null }, - "macro.dbt.build_ref_function": { - "name": "build_ref_function", + "macro.dbt.snapshot_check_strategy": { + "name": "snapshot_check_strategy", "resource_type": "macro", "package_name": "dbt", - "path": "macros/python_model/python.sql", - "original_file_path": "macros/python_model/python.sql", - "unique_id": "macro.dbt.build_ref_function", - "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", + "path": "macros/materializations/snapshots/strategies.sql", + "original_file_path": "macros/materializations/snapshots/strategies.sql", + "unique_id": "macro.dbt.snapshot_check_strategy", + "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.resolve_model_name" + "macro.dbt.snapshot_get_time", + "macro.dbt.snapshot_check_all_get_existing_columns", + "macro.dbt.get_true_sql", + "macro.dbt.snapshot_hash_arguments" ] }, "description": "", @@ -4132,20 +4956,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3094857, + "created_at": 1728697972.511777, "supported_languages": null }, - "macro.dbt.build_source_function": { - "name": "build_source_function", + "macro.dbt.create_columns": { + "name": "create_columns", "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 %}", + "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.resolve_model_name" + "macro.dbt.default__create_columns" ] }, "description": "", @@ -4156,19 +4980,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.309789, + "created_at": 1728697972.5144188, "supported_languages": null }, - "macro.dbt.build_config_dict": { - "name": "build_config_dict", + "macro.dbt.default__create_columns": { + "name": "default__create_columns", "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 %}", + "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 \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -4178,25 +5004,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3102064, + "created_at": 1728697972.514581, "supported_languages": null }, - "macro.dbt.py_script_postfix": { - "name": "py_script_postfix", + "macro.dbt.post_snapshot": { + "name": "post_snapshot", "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 %}", + "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.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" + "macro.dbt.default__post_snapshot" ] }, "description": "", @@ -4207,17 +5028,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3105428, + "created_at": 1728697972.514673, "supported_languages": null }, - "macro.dbt.py_script_comment": { - "name": "py_script_comment", + "macro.dbt.default__post_snapshot": { + "name": "default__post_snapshot", "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%}", + "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": [] }, @@ -4229,20 +5050,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3105974, + "created_at": 1728697972.5147252, "supported_languages": null }, - "macro.dbt.run_hooks": { - "name": "run_hooks", + "macro.dbt.get_true_sql": { + "name": "get_true_sql", "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 %}", + "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.statement" + "macro.dbt.default__get_true_sql" ] }, "description": "", @@ -4253,17 +5074,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3113625, + "created_at": 1728697972.514807, "supported_languages": null }, - "macro.dbt.make_hook_config": { - "name": "make_hook_config", + "macro.dbt.default__get_true_sql": { + "name": "default__get_true_sql", "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 %}", + "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": [] }, @@ -4275,20 +5096,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3114946, + "created_at": 1728697972.514869, "supported_languages": null }, - "macro.dbt.before_begin": { - "name": "before_begin", + "macro.dbt.snapshot_staging_table": { + "name": "snapshot_staging_table", "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 %}", + "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.make_hook_config" + "macro.dbt.default__snapshot_staging_table" ] }, "description": "", @@ -4299,20 +5120,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3116074, + "created_at": 1728697972.514982, "supported_languages": null }, - "macro.dbt.in_transaction": { - "name": "in_transaction", + "macro.dbt.default__snapshot_staging_table": { + "name": "default__snapshot_staging_table", "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 %}", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "unique_id": "macro.dbt.default__snapshot_staging_table", + "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", "depends_on": { "macros": [ - "macro.dbt.make_hook_config" + "macro.dbt.snapshot_get_time" ] }, "description": "", @@ -4323,20 +5144,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3117213, + "created_at": 1728697972.5154848, "supported_languages": null }, - "macro.dbt.after_commit": { - "name": "after_commit", + "macro.dbt.build_snapshot_table": { + "name": "build_snapshot_table", "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 %}", + "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.make_hook_config" + "macro.dbt.default__build_snapshot_table" ] }, "description": "", @@ -4347,17 +5168,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3118157, + "created_at": 1728697972.515593, "supported_languages": null }, - "macro.dbt.set_sql_header": { - "name": "set_sql_header", + "macro.dbt.default__build_snapshot_table": { + "name": "default__build_snapshot_table", "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 %}", + "path": "macros/materializations/snapshots/helpers.sql", + "original_file_path": "macros/materializations/snapshots/helpers.sql", + "unique_id": "macro.dbt.default__build_snapshot_table", + "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", "depends_on": { "macros": [] }, @@ -4369,19 +5190,24 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3120933, + "created_at": 1728697972.5157309, "supported_languages": null }, - "macro.dbt.should_full_refresh": { - "name": "should_full_refresh", + "macro.dbt.build_snapshot_staging_table": { + "name": "build_snapshot_staging_table", "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 %}", + "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": [] + "macros": [ + "macro.dbt.make_temp_relation", + "macro.dbt.snapshot_staging_table", + "macro.dbt.statement", + "macro.dbt.create_table_as" + ] }, "description": "", "meta": {}, @@ -4391,19 +5217,34 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3123076, + "created_at": 1728697972.5159612, "supported_languages": null }, - "macro.dbt.should_store_failures": { - "name": "should_store_failures", + "macro.dbt.materialization_snapshot_default": { + "name": "materialization_snapshot_default", "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 %}", + "path": "macros/materializations/snapshots/snapshot.sql", + "original_file_path": "macros/materializations/snapshots/snapshot.sql", + "unique_id": "macro.dbt.materialization_snapshot_default", + "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_or_create_relation", + "macro.dbt.run_hooks", + "macro.dbt.strategy_dispatch", + "macro.dbt.build_snapshot_table", + "macro.dbt.create_table_as", + "macro.dbt.build_snapshot_staging_table", + "macro.dbt.create_columns", + "macro.dbt.snapshot_merge_sql", + "macro.dbt.statement", + "macro.dbt.should_revoke", + "macro.dbt.apply_grants", + "macro.dbt.persist_docs", + "macro.dbt.create_indexes", + "macro.dbt.post_snapshot" + ] }, "description": "", "meta": {}, @@ -4413,8 +5254,10 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.312511, - "supported_languages": null + "created_at": 1728697972.519595, + "supported_languages": [ + "sql" + ] }, "macro.dbt.materialization_test_default": { "name": "materialization_test_default", @@ -4440,7 +5283,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.314438, + "created_at": 1728697972.5211678, "supported_languages": [ "sql" ] @@ -4466,7 +5309,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3153021, + "created_at": 1728697972.521891, "supported_languages": null }, "macro.dbt.default__get_test_sql": { @@ -4488,7 +5331,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.315511, + "created_at": 1728697972.52206, "supported_languages": null }, "macro.dbt.get_unit_test_sql": { @@ -4512,7 +5355,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.31566, + "created_at": 1728697972.522174, "supported_languages": null }, "macro.dbt.default__get_unit_test_sql": { @@ -4536,42 +5379,9 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.316083, + "created_at": 1728697972.5225248, "supported_languages": null }, - "macro.dbt.materialization_unit_default": { - "name": "materialization_unit_default", - "resource_type": "macro", - "package_name": "dbt", - "path": "macros/materializations/tests/unit.sql", - "original_file_path": "macros/materializations/tests/unit.sql", - "unique_id": "macro.dbt.materialization_unit_default", - "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", - "depends_on": { - "macros": [ - "macro.dbt.get_columns_in_query", - "macro.dbt.make_temp_relation", - "macro.dbt.run_query", - "macro.dbt.get_create_table_as_sql", - "macro.dbt.get_empty_subquery_sql", - "macro.dbt.get_expected_sql", - "macro.dbt.get_unit_test_sql", - "macro.dbt.statement" - ] - }, - "description": "", - "meta": {}, - "docs": { - "show": true, - "node_color": null - }, - "patch_path": null, - "arguments": [], - "created_at": 1718342580.3175333, - "supported_languages": [ - "sql" - ] - }, "macro.dbt.get_where_subquery": { "name": "get_where_subquery", "resource_type": "macro", @@ -4593,7 +5403,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3178751, + "created_at": 1728697972.5227652, "supported_languages": null }, "macro.dbt.default__get_where_subquery": { @@ -4615,20 +5425,27 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3181915, + "created_at": 1728697972.522985, "supported_languages": null }, - "macro.dbt.create_columns": { - "name": "create_columns", + "macro.dbt.materialization_unit_default": { + "name": "materialization_unit_default", "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 %}", + "path": "macros/materializations/tests/unit.sql", + "original_file_path": "macros/materializations/tests/unit.sql", + "unique_id": "macro.dbt.materialization_unit_default", + "macro_sql": "{%- materialization unit, default -%}\n\n {% set relations = [] %}\n\n {% set expected_rows = config.get('expected_rows') %}\n {% set expected_sql = config.get('expected_sql') %}\n {% set tested_expected_column_names = expected_rows[0].keys() if (expected_rows | length ) > 0 else get_columns_in_query(sql) %} %}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {% do run_query(get_create_table_as_sql(True, temp_relation, get_empty_subquery_sql(sql))) %}\n {%- set columns_in_relation = adapter.get_columns_in_relation(temp_relation) -%}\n {%- set column_name_to_data_types = {} -%}\n {%- for column in columns_in_relation -%}\n {%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n {%- endfor -%}\n\n {% if not expected_sql %}\n {% set expected_sql = get_expected_sql(expected_rows, column_name_to_data_types) %}\n {% endif %}\n {% set unit_test_sql = get_unit_test_sql(sql, expected_sql, tested_expected_column_names) %}\n\n {% call statement('main', fetch_result=True) -%}\n\n {{ unit_test_sql }}\n\n {%- endcall %}\n\n {% do adapter.drop_relation(temp_relation) %}\n\n {{ return({'relations': relations}) }}\n\n{%- endmaterialization -%}", "depends_on": { "macros": [ - "macro.dbt.default__create_columns" + "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": "", @@ -4639,20 +5456,29 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3215861, - "supported_languages": null + "created_at": 1728697972.5240169, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.default__create_columns": { - "name": "default__create_columns", + "macro.dbt.materialization_materialized_view_default": { + "name": "materialization_materialized_view_default", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/helpers.sql", - "original_file_path": "macros/materializations/snapshots/helpers.sql", - "unique_id": "macro.dbt.default__create_columns", - "macro_sql": "{% macro default__create_columns(relation, columns) %}\n {% for column in columns %}\n {% call statement() %}\n alter table {{ relation }} add column \"{{ column.name }}\" {{ column.data_type }};\n {% endcall %}\n {% endfor %}\n{% endmacro %}", + "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.statement" + "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": "", @@ -4663,20 +5489,24 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.321788, - "supported_languages": null + "created_at": 1728697972.527294, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.post_snapshot": { - "name": "post_snapshot", + "macro.dbt.materialized_view_setup": { + "name": "materialized_view_setup", "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 %}", + "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.default__post_snapshot" + "macro.dbt.load_cached_relation", + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks" ] }, "description": "", @@ -4687,19 +5517,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.321907, + "created_at": 1728697972.527562, "supported_languages": null }, - "macro.dbt.default__post_snapshot": { - "name": "default__post_snapshot", + "macro.dbt.materialized_view_teardown": { + "name": "materialized_view_teardown", "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 %}", + "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": [] + "macros": [ + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks" + ] }, "description": "", "meta": {}, @@ -4709,20 +5542,25 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3219738, + "created_at": 1728697972.527712, "supported_languages": null }, - "macro.dbt.get_true_sql": { - "name": "get_true_sql", + "macro.dbt.materialized_view_get_build_sql": { + "name": "materialized_view_get_build_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 %}", + "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.default__get_true_sql" + "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": "", @@ -4733,17 +5571,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3221614, + "created_at": 1728697972.528456, "supported_languages": null }, - "macro.dbt.default__get_true_sql": { - "name": "default__get_true_sql", + "macro.dbt.materialized_view_execute_no_op": { + "name": "materialized_view_execute_no_op", "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 %}", + "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": [] }, @@ -4755,20 +5593,24 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.322244, + "created_at": 1728697972.5286, "supported_languages": null }, - "macro.dbt.snapshot_staging_table": { - "name": "snapshot_staging_table", + "macro.dbt.materialized_view_execute_build_sql": { + "name": "materialized_view_execute_build_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.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 %}", + "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.default__snapshot_staging_table" + "macro.dbt.run_hooks", + "macro.dbt.statement", + "macro.dbt.should_revoke", + "macro.dbt.apply_grants", + "macro.dbt.persist_docs" ] }, "description": "", @@ -4779,20 +5621,29 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.322382, + "created_at": 1728697972.528961, "supported_languages": null }, - "macro.dbt.default__snapshot_staging_table": { - "name": "default__snapshot_staging_table", + "macro.dbt.materialization_view_default": { + "name": "materialization_view_default", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/helpers.sql", - "original_file_path": "macros/materializations/snapshots/helpers.sql", - "unique_id": "macro.dbt.default__snapshot_staging_table", - "macro_sql": "{% macro default__snapshot_staging_table(strategy, source_sql, target_relation) -%}\n\n with snapshot_query as (\n\n {{ source_sql }}\n\n ),\n\n snapshotted_data as (\n\n select *,\n {{ strategy.unique_key }} as dbt_unique_key\n\n from {{ target_relation }}\n where dbt_valid_to is null\n\n ),\n\n insertions_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to,\n {{ strategy.scd_id }} as dbt_scd_id\n\n from snapshot_query\n ),\n\n updates_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n {{ strategy.updated_at }} as dbt_valid_to\n\n from snapshot_query\n ),\n\n {%- if strategy.invalidate_hard_deletes %}\n\n deletes_source_data as (\n\n select\n *,\n {{ strategy.unique_key }} as dbt_unique_key\n from snapshot_query\n ),\n {% endif %}\n\n insertions as (\n\n select\n 'insert' as dbt_change_type,\n source_data.*\n\n from insertions_source_data as source_data\n left outer join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where snapshotted_data.dbt_unique_key is null\n or (\n snapshotted_data.dbt_unique_key is not null\n and (\n {{ strategy.row_changed }}\n )\n )\n\n ),\n\n updates as (\n\n select\n 'update' as dbt_change_type,\n source_data.*,\n snapshotted_data.dbt_scd_id\n\n from updates_source_data as source_data\n join snapshotted_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where (\n {{ strategy.row_changed }}\n )\n )\n\n {%- if strategy.invalidate_hard_deletes -%}\n ,\n\n deletes as (\n\n select\n 'delete' as dbt_change_type,\n source_data.*,\n {{ snapshot_get_time() }} as dbt_valid_from,\n {{ snapshot_get_time() }} as dbt_updated_at,\n {{ snapshot_get_time() }} as dbt_valid_to,\n snapshotted_data.dbt_scd_id\n\n from snapshotted_data\n left join deletes_source_data as source_data on snapshotted_data.dbt_unique_key = source_data.dbt_unique_key\n where source_data.dbt_unique_key is null\n )\n {%- endif %}\n\n select * from insertions\n union all\n select * from updates\n {%- if strategy.invalidate_hard_deletes %}\n union all\n select * from deletes\n {%- endif %}\n\n{%- endmacro %}", + "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.snapshot_get_time" + "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": "", @@ -4803,20 +5654,32 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.323044, - "supported_languages": null + "created_at": 1728697972.530999, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.build_snapshot_table": { - "name": "build_snapshot_table", + "macro.dbt.materialization_table_default": { + "name": "materialization_table_default", "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 %}", + "path": "macros/materializations/models/table.sql", + "original_file_path": "macros/materializations/models/table.sql", + "unique_id": "macro.dbt.materialization_table_default", + "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", "depends_on": { "macros": [ - "macro.dbt.default__build_snapshot_table" + "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": "", @@ -4827,46 +5690,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3231754, - "supported_languages": null - }, - "macro.dbt.default__build_snapshot_table": { - "name": "default__build_snapshot_table", - "resource_type": "macro", - "package_name": "dbt", - "path": "macros/materializations/snapshots/helpers.sql", - "original_file_path": "macros/materializations/snapshots/helpers.sql", - "unique_id": "macro.dbt.default__build_snapshot_table", - "macro_sql": "{% macro default__build_snapshot_table(strategy, sql) %}\n\n select *,\n {{ strategy.scd_id }} as dbt_scd_id,\n {{ strategy.updated_at }} as dbt_updated_at,\n {{ strategy.updated_at }} as dbt_valid_from,\n nullif({{ strategy.updated_at }}, {{ strategy.updated_at }}) as dbt_valid_to\n from (\n {{ sql }}\n ) sbq\n\n{% endmacro %}", - "depends_on": { - "macros": [] - }, - "description": "", - "meta": {}, - "docs": { - "show": true, - "node_color": null - }, - "patch_path": null, - "arguments": [], - "created_at": 1718342580.3233507, - "supported_languages": null + "created_at": 1728697972.532898, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.build_snapshot_staging_table": { - "name": "build_snapshot_staging_table", + "macro.dbt.get_quoted_csv": { + "name": "get_quoted_csv", "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 %}", + "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": [ - "macro.dbt.make_temp_relation", - "macro.dbt.snapshot_staging_table", - "macro.dbt.statement", - "macro.dbt.create_table_as" - ] + "macros": [] }, "description": "", "meta": {}, @@ -4876,34 +5714,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3236485, + "created_at": 1728697972.533914, "supported_languages": null }, - "macro.dbt.materialization_snapshot_default": { - "name": "materialization_snapshot_default", + "macro.dbt.diff_columns": { + "name": "diff_columns", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/snapshot.sql", - "original_file_path": "macros/materializations/snapshots/snapshot.sql", - "unique_id": "macro.dbt.materialization_snapshot_default", - "macro_sql": "{% materialization snapshot, default %}\n {%- set config = model['config'] -%}\n\n {%- set target_table = model.get('alias', model.get('name')) -%}\n\n {%- set strategy_name = config.get('strategy') -%}\n {%- set unique_key = config.get('unique_key') %}\n -- grab current tables grants config for comparision later on\n {%- set grant_config = config.get('grants') -%}\n\n {% set target_relation_exists, target_relation = get_or_create_relation(\n database=model.database,\n schema=model.schema,\n identifier=target_table,\n type='table') -%}\n\n {%- if not target_relation.is_table -%}\n {% do exceptions.relation_wrong_type(target_relation, 'table') %}\n {%- endif -%}\n\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set strategy_macro = strategy_dispatch(strategy_name) %}\n {% set strategy = strategy_macro(model, \"snapshotted_data\", \"source_data\", config, target_relation_exists) %}\n\n {% if not target_relation_exists %}\n\n {% set build_sql = build_snapshot_table(strategy, model['compiled_code']) %}\n {% set final_sql = create_table_as(False, target_relation, build_sql) %}\n\n {% else %}\n\n {{ adapter.valid_snapshot_target(target_relation) }}\n\n {% set staging_table = build_snapshot_staging_table(strategy, sql, target_relation) %}\n\n -- this may no-op if the database does not require column expansion\n {% do adapter.expand_target_column_types(from_relation=staging_table,\n to_relation=target_relation) %}\n\n {% set missing_columns = adapter.get_missing_columns(staging_table, target_relation)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% do create_columns(target_relation, missing_columns) %}\n\n {% set source_columns = adapter.get_columns_in_relation(staging_table)\n | rejectattr('name', 'equalto', 'dbt_change_type')\n | rejectattr('name', 'equalto', 'DBT_CHANGE_TYPE')\n | rejectattr('name', 'equalto', 'dbt_unique_key')\n | rejectattr('name', 'equalto', 'DBT_UNIQUE_KEY')\n | list %}\n\n {% set quoted_source_columns = [] %}\n {% for column in source_columns %}\n {% do quoted_source_columns.append(adapter.quote(column.name)) %}\n {% endfor %}\n\n {% set final_sql = snapshot_merge_sql(\n target = target_relation,\n source = staging_table,\n insert_cols = quoted_source_columns\n )\n %}\n\n {% endif %}\n\n {% call statement('main') %}\n {{ final_sql }}\n {% endcall %}\n\n {% set should_revoke = should_revoke(target_relation_exists, full_refresh_mode=False) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if not target_relation_exists %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {{ adapter.commit() }}\n\n {% if staging_table is defined %}\n {% do post_snapshot(staging_table) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", + "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": [ - "macro.dbt.get_or_create_relation", - "macro.dbt.run_hooks", - "macro.dbt.strategy_dispatch", - "macro.dbt.build_snapshot_table", - "macro.dbt.create_table_as", - "macro.dbt.build_snapshot_staging_table", - "macro.dbt.create_columns", - "macro.dbt.snapshot_merge_sql", - "macro.dbt.statement", - "macro.dbt.should_revoke", - "macro.dbt.apply_grants", - "macro.dbt.persist_docs", - "macro.dbt.create_indexes", - "macro.dbt.post_snapshot" - ] + "macros": [] }, "description": "", "meta": {}, @@ -4913,23 +5736,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.328658, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.5342112, + "supported_languages": null }, - "macro.dbt.snapshot_merge_sql": { - "name": "snapshot_merge_sql", + "macro.dbt.diff_column_data_types": { + "name": "diff_column_data_types", "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 %}", + "path": "macros/materializations/models/incremental/column_helpers.sql", + "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", + "unique_id": "macro.dbt.diff_column_data_types", + "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", "depends_on": { - "macros": [ - "macro.dbt_postgres.postgres__snapshot_merge_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -4939,19 +5758,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3290915, + "created_at": 1728697972.5345669, "supported_languages": null }, - "macro.dbt.default__snapshot_merge_sql": { - "name": "default__snapshot_merge_sql", + "macro.dbt.get_merge_update_columns": { + "name": "get_merge_update_columns", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/snapshot_merge.sql", - "original_file_path": "macros/materializations/snapshots/snapshot_merge.sql", - "unique_id": "macro.dbt.default__snapshot_merge_sql", - "macro_sql": "{% macro default__snapshot_merge_sql(target, source, insert_cols) -%}\n {%- set insert_cols_csv = insert_cols | join(', ') -%}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on DBT_INTERNAL_SOURCE.dbt_scd_id = DBT_INTERNAL_DEST.dbt_scd_id\n\n when matched\n and DBT_INTERNAL_DEST.dbt_valid_to is null\n and DBT_INTERNAL_SOURCE.dbt_change_type in ('update', 'delete')\n then update\n set dbt_valid_to = DBT_INTERNAL_SOURCE.dbt_valid_to\n\n when not matched\n and DBT_INTERNAL_SOURCE.dbt_change_type = 'insert'\n then insert ({{ insert_cols_csv }})\n values ({{ insert_cols_csv }})\n\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.default__get_merge_update_columns" + ] }, "description": "", "meta": {}, @@ -4961,17 +5782,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3293147, + "created_at": 1728697972.534693, "supported_languages": null }, - "macro.dbt.strategy_dispatch": { - "name": "strategy_dispatch", + "macro.dbt.default__get_merge_update_columns": { + "name": "default__get_merge_update_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.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 %}", + "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": [] }, @@ -4983,20 +5804,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3320215, + "created_at": 1728697972.5350919, "supported_languages": null }, - "macro.dbt.snapshot_hash_arguments": { - "name": "snapshot_hash_arguments", + "macro.dbt.get_merge_sql": { + "name": "get_merge_sql", "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 %}", + "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__snapshot_hash_arguments" + "macro.dbt.default__get_merge_sql" ] }, "description": "", @@ -5007,19 +5828,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3321457, + "created_at": 1728697972.538962, "supported_languages": null }, - "macro.dbt.default__snapshot_hash_arguments": { - "name": "default__snapshot_hash_arguments", + "macro.dbt.default__get_merge_sql": { + "name": "default__get_merge_sql", "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 %}", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "unique_id": "macro.dbt.default__get_merge_sql", + "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.get_quoted_csv", + "macro.dbt.get_merge_update_columns" + ] }, "description": "", "meta": {}, @@ -5029,20 +5853,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3323102, + "created_at": 1728697972.5399082, "supported_languages": null }, - "macro.dbt.snapshot_timestamp_strategy": { - "name": "snapshot_timestamp_strategy", + "macro.dbt.get_delete_insert_merge_sql": { + "name": "get_delete_insert_merge_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/strategies.sql", - "original_file_path": "macros/materializations/snapshots/strategies.sql", - "unique_id": "macro.dbt.snapshot_timestamp_strategy", - "macro_sql": "{% macro snapshot_timestamp_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set primary_key = config['unique_key'] %}\n {% set updated_at = config['updated_at'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n\n {#/*\n The snapshot relation might not have an {{ updated_at }} value if the\n snapshot strategy is changed from `check` to `timestamp`. We\n should use a dbt-created column for the comparison in the snapshot\n table instead of assuming that the user-supplied {{ updated_at }}\n will be present in the historical data.\n\n See https://github.com/dbt-labs/dbt-core/issues/2350\n */ #}\n {% set row_changed_expr -%}\n ({{ snapshotted_rel }}.dbt_valid_from < {{ current_rel }}.{{ updated_at }})\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", + "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.snapshot_hash_arguments" + "macro.dbt.default__get_delete_insert_merge_sql" ] }, "description": "", @@ -5053,20 +5877,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.332831, + "created_at": 1728697972.540055, "supported_languages": null }, - "macro.dbt.snapshot_string_as_time": { - "name": "snapshot_string_as_time", + "macro.dbt.default__get_delete_insert_merge_sql": { + "name": "default__get_delete_insert_merge_sql", "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 %}", + "path": "macros/materializations/models/incremental/merge.sql", + "original_file_path": "macros/materializations/models/incremental/merge.sql", + "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", + "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__snapshot_string_as_time" + "macro.dbt.get_quoted_csv" ] }, "description": "", @@ -5077,19 +5901,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.332951, + "created_at": 1728697972.5406, "supported_languages": null }, - "macro.dbt.default__snapshot_string_as_time": { - "name": "default__snapshot_string_as_time", + "macro.dbt.get_insert_overwrite_merge_sql": { + "name": "get_insert_overwrite_merge_sql", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__get_insert_overwrite_merge_sql" + ] }, "description": "", "meta": {}, @@ -5099,20 +5925,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3331652, + "created_at": 1728697972.540749, "supported_languages": null }, - "macro.dbt.snapshot_check_all_get_existing_columns": { - "name": "snapshot_check_all_get_existing_columns", + "macro.dbt.default__get_insert_overwrite_merge_sql": { + "name": "default__get_insert_overwrite_merge_sql", "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 %}", + "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_columns_in_query" + "macro.dbt.get_quoted_csv" ] }, "description": "", @@ -5123,23 +5949,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3342044, + "created_at": 1728697972.5410979, "supported_languages": null }, - "macro.dbt.snapshot_check_strategy": { - "name": "snapshot_check_strategy", + "macro.dbt.is_incremental": { + "name": "is_incremental", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/snapshots/strategies.sql", - "original_file_path": "macros/materializations/snapshots/strategies.sql", - "unique_id": "macro.dbt.snapshot_check_strategy", - "macro_sql": "{% macro snapshot_check_strategy(node, snapshotted_rel, current_rel, config, target_exists) %}\n {% set check_cols_config = config['check_cols'] %}\n {% set primary_key = config['unique_key'] %}\n {% set invalidate_hard_deletes = config.get('invalidate_hard_deletes', false) %}\n {% set updated_at = config.get('updated_at', snapshot_get_time()) %}\n\n {% set column_added = false %}\n\n {% set column_added, check_cols = snapshot_check_all_get_existing_columns(node, target_exists, check_cols_config) %}\n\n {%- set row_changed_expr -%}\n (\n {%- if column_added -%}\n {{ get_true_sql() }}\n {%- else -%}\n {%- for col in check_cols -%}\n {{ snapshotted_rel }}.{{ col }} != {{ current_rel }}.{{ col }}\n or\n (\n (({{ snapshotted_rel }}.{{ col }} is null) and not ({{ current_rel }}.{{ col }} is null))\n or\n ((not {{ snapshotted_rel }}.{{ col }} is null) and ({{ current_rel }}.{{ col }} is null))\n )\n {%- if not loop.last %} or {% endif -%}\n {%- endfor -%}\n {%- endif -%}\n )\n {%- endset %}\n\n {% set scd_id_expr = snapshot_hash_arguments([primary_key, updated_at]) %}\n\n {% do return({\n \"unique_key\": primary_key,\n \"updated_at\": updated_at,\n \"row_changed\": row_changed_expr,\n \"scd_id\": scd_id_expr,\n \"invalidate_hard_deletes\": invalidate_hard_deletes\n }) %}\n{% endmacro %}", + "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.snapshot_get_time", - "macro.dbt.snapshot_check_all_get_existing_columns", - "macro.dbt.get_true_sql", - "macro.dbt.snapshot_hash_arguments" + "macro.dbt.should_full_refresh" ] }, "description": "", @@ -5150,20 +5973,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3354924, + "created_at": 1728697972.541456, "supported_languages": null }, - "macro.dbt.create_csv_table": { - "name": "create_csv_table", + "macro.dbt.get_incremental_append_sql": { + "name": "get_incremental_append_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.create_csv_table", - "macro_sql": "{% macro create_csv_table(model, agate_table) -%}\n {{ adapter.dispatch('create_csv_table', 'dbt')(model, agate_table) }}\n{%- endmacro %}", + "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__create_csv_table" + "macro.dbt.default__get_incremental_append_sql" ] }, "description": "", @@ -5174,20 +5997,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3393958, + "created_at": 1728697972.5420318, "supported_languages": null }, - "macro.dbt.default__create_csv_table": { - "name": "default__create_csv_table", + "macro.dbt.default__get_incremental_append_sql": { + "name": "default__get_incremental_append_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__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 %}", + "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.statement" + "macro.dbt.get_insert_into_sql" ] }, "description": "", @@ -5198,20 +6021,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3400016, + "created_at": 1728697972.542163, "supported_languages": null }, - "macro.dbt.reset_csv_table": { - "name": "reset_csv_table", + "macro.dbt.get_incremental_delete_insert_sql": { + "name": "get_incremental_delete_insert_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.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 %}", + "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__reset_csv_table" + "macro.dbt.default__get_incremental_delete_insert_sql" ] }, "description": "", @@ -5222,20 +6045,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3401587, + "created_at": 1728697972.542273, "supported_languages": null }, - "macro.dbt.default__reset_csv_table": { - "name": "default__reset_csv_table", + "macro.dbt.default__get_incremental_delete_insert_sql": { + "name": "default__get_incremental_delete_insert_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__reset_csv_table", - "macro_sql": "{% macro default__reset_csv_table(model, full_refresh, old_relation, agate_table) %}\n {% set sql = \"\" %}\n {% if full_refresh %}\n {{ adapter.drop_relation(old_relation) }}\n {% set sql = create_csv_table(model, agate_table) %}\n {% else %}\n {{ adapter.truncate_relation(old_relation) }}\n {% set sql = \"truncate table \" ~ old_relation %}\n {% endif %}\n\n {{ return(sql) }}\n{% endmacro %}", + "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.create_csv_table" + "macro.dbt.get_delete_insert_merge_sql" ] }, "description": "", @@ -5246,20 +6069,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3404777, + "created_at": 1728697972.542432, "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 %}", + "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_csv_sql" + "macro.dbt.default__get_incremental_merge_sql" ] }, "description": "", @@ -5270,19 +6093,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3406224, + "created_at": 1728697972.542537, "supported_languages": null }, - "macro.dbt.default__get_csv_sql": { - "name": "default__get_csv_sql", + "macro.dbt.default__get_incremental_merge_sql": { + "name": "default__get_incremental_merge_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 %}", + "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": [] + "macros": [ + "macro.dbt.get_merge_sql" + ] }, "description": "", "meta": {}, @@ -5292,20 +6117,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.340714, + "created_at": 1728697972.5427022, "supported_languages": null }, - "macro.dbt.get_binding_char": { - "name": "get_binding_char", + "macro.dbt.get_incremental_insert_overwrite_sql": { + "name": "get_incremental_insert_overwrite_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_binding_char", - "macro_sql": "{% macro get_binding_char() -%}\n {{ adapter.dispatch('get_binding_char', 'dbt')() }}\n{%- endmacro %}", + "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_binding_char" + "macro.dbt.default__get_incremental_insert_overwrite_sql" ] }, "description": "", @@ -5316,19 +6141,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3408084, + "created_at": 1728697972.542805, "supported_languages": null }, - "macro.dbt.default__get_binding_char": { - "name": "default__get_binding_char", + "macro.dbt.default__get_incremental_insert_overwrite_sql": { + "name": "default__get_incremental_insert_overwrite_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_binding_char", - "macro_sql": "{% macro default__get_binding_char() %}\n {{ return('%s') }}\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.get_insert_overwrite_merge_sql" + ] }, "description": "", "meta": {}, @@ -5338,20 +6165,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3408844, + "created_at": 1728697972.542945, "supported_languages": null }, - "macro.dbt.get_batch_size": { - "name": "get_batch_size", + "macro.dbt.get_incremental_default_sql": { + "name": "get_incremental_default_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_batch_size", - "macro_sql": "{% macro get_batch_size() -%}\n {{ return(adapter.dispatch('get_batch_size', 'dbt')()) }}\n{%- endmacro %}", + "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.default__get_batch_size" + "macro.dbt_postgres.postgres__get_incremental_default_sql" ] }, "description": "", @@ -5362,19 +6189,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3409917, + "created_at": 1728697972.543048, "supported_languages": null }, - "macro.dbt.default__get_batch_size": { - "name": "default__get_batch_size", + "macro.dbt.default__get_incremental_default_sql": { + "name": "default__get_incremental_default_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_batch_size", - "macro_sql": "{% macro default__get_batch_size() %}\n {{ return(10000) }}\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.get_incremental_append_sql" + ] }, "description": "", "meta": {}, @@ -5384,19 +6213,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3410702, + "created_at": 1728697972.543133, "supported_languages": null }, - "macro.dbt.get_seed_column_quoted_csv": { - "name": "get_seed_column_quoted_csv", + "macro.dbt.get_insert_into_sql": { + "name": "get_insert_into_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_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 %}", + "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": [] + "macros": [ + "macro.dbt.get_quoted_csv" + ] }, "description": "", "meta": {}, @@ -5406,20 +6237,35 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3413827, + "created_at": 1728697972.5432901, "supported_languages": null }, - "macro.dbt.load_csv_rows": { - "name": "load_csv_rows", + "macro.dbt.materialization_incremental_default": { + "name": "materialization_incremental_default", "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 %}", + "path": "macros/materializations/models/incremental/incremental.sql", + "original_file_path": "macros/materializations/models/incremental/incremental.sql", + "unique_id": "macro.dbt.materialization_incremental_default", + "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% 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_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", "depends_on": { "macros": [ - "macro.dbt.default__load_csv_rows" + "macro.dbt.load_cached_relation", + "macro.dbt.make_temp_relation", + "macro.dbt.make_intermediate_relation", + "macro.dbt.make_backup_relation", + "macro.dbt.should_full_refresh", + "macro.dbt.incremental_validate_on_schema_change", + "macro.dbt.drop_relation_if_exists", + "macro.dbt.run_hooks", + "macro.dbt.get_create_table_as_sql", + "macro.dbt.run_query", + "macro.dbt.process_schema_changes", + "macro.dbt.statement", + "macro.dbt.should_revoke", + "macro.dbt.apply_grants", + "macro.dbt.persist_docs", + "macro.dbt.create_indexes" ] }, "description": "", @@ -5430,23 +6276,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3415093, - "supported_languages": null + "created_at": 1728697972.5464342, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.default__load_csv_rows": { - "name": "default__load_csv_rows", + "macro.dbt.incremental_validate_on_schema_change": { + "name": "incremental_validate_on_schema_change", "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 %}", + "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": [ - "macro.dbt.get_batch_size", - "macro.dbt.get_seed_column_quoted_csv", - "macro.dbt.get_binding_char" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5456,30 +6300,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3423326, + "created_at": 1728697972.550059, "supported_languages": null }, - "macro.dbt.materialization_seed_default": { - "name": "materialization_seed_default", + "macro.dbt.check_for_schema_changes": { + "name": "check_for_schema_changes", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/seeds/seed.sql", - "original_file_path": "macros/materializations/seeds/seed.sql", - "unique_id": "macro.dbt.materialization_seed_default", - "macro_sql": "{% materialization seed, default %}\n\n {%- set identifier = model['alias'] -%}\n {%- set full_refresh_mode = (should_full_refresh()) -%}\n\n {%- set old_relation = adapter.get_relation(database=database, schema=schema, identifier=identifier) -%}\n\n {%- set exists_as_table = (old_relation is not none and old_relation.is_table) -%}\n {%- set exists_as_view = (old_relation is not none and old_relation.is_view) -%}\n\n {%- set grant_config = config.get('grants') -%}\n {%- set agate_table = load_agate_table() -%}\n -- grab current tables grants config for comparison later on\n\n {%- do store_result('agate_table', response='OK', agate_table=agate_table) -%}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% set create_table_sql = \"\" %}\n {% if exists_as_view %}\n {{ exceptions.raise_compiler_error(\"Cannot seed to '{}', it is a view\".format(old_relation)) }}\n {% elif exists_as_table %}\n {% set create_table_sql = reset_csv_table(model, full_refresh_mode, old_relation, agate_table) %}\n {% else %}\n {% set create_table_sql = create_csv_table(model, agate_table) %}\n {% endif %}\n\n {% set code = 'CREATE' if full_refresh_mode else 'INSERT' %}\n {% set rows_affected = (agate_table.rows | length) %}\n {% set sql = load_csv_rows(model, agate_table) %}\n\n {% call noop_statement('main', code ~ ' ' ~ rows_affected, code, rows_affected) %}\n {{ get_csv_sql(create_table_sql, sql) }};\n {% endcall %}\n\n {% set target_relation = this.incorporate(type='table') %}\n\n {% set should_revoke = should_revoke(old_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if full_refresh_mode or not exists_as_table %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{% endmaterialization %}", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "unique_id": "macro.dbt.check_for_schema_changes", + "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.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" + "macro.dbt.diff_columns", + "macro.dbt.diff_column_data_types" ] }, "description": "", @@ -5490,32 +6325,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.344582, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.550721, + "supported_languages": null }, - "macro.dbt.materialization_table_default": { - "name": "materialization_table_default", + "macro.dbt.sync_column_schemas": { + "name": "sync_column_schemas", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/table.sql", - "original_file_path": "macros/materializations/models/table.sql", - "unique_id": "macro.dbt.materialization_table_default", - "macro_sql": "{% materialization table, default %}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') %}\n {%- set intermediate_relation = make_intermediate_relation(target_relation) -%}\n -- the intermediate_relation should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation) -%}\n /*\n See ../view/view.sql for more information about this relation.\n */\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n -- as above, the backup_relation should not already exist\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n\n -- drop the temp relations if they exist already in the database\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n -- build model\n {% call statement('main') -%}\n {{ get_create_table_as_sql(False, intermediate_relation, sql) }}\n {%- endcall %}\n\n -- cleanup\n {% if existing_relation is not none %}\n /* Do the equivalent of rename_if_exists. 'existing_relation' could have been dropped\n since the variable was first set. */\n {% set existing_relation = load_cached_relation(existing_relation) %}\n {% if existing_relation is not none %}\n {{ adapter.rename_relation(existing_relation, backup_relation) }}\n {% endif %}\n {% endif %}\n\n {{ adapter.rename_relation(intermediate_relation, target_relation) }}\n\n {% do create_indexes(target_relation) %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n -- `COMMIT` happens here\n {{ adapter.commit() }}\n\n -- finally, drop the existing/backup relation after the commit\n {{ drop_relation_if_exists(backup_relation) }}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n{% endmaterialization %}", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "unique_id": "macro.dbt.sync_column_schemas", + "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.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" + "macro.dbt.alter_relation_add_remove_columns", + "macro.dbt.alter_column_type" ] }, "description": "", @@ -5526,31 +6350,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3466704, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.551391, + "supported_languages": null }, - "macro.dbt.materialization_view_default": { - "name": "materialization_view_default", + "macro.dbt.process_schema_changes": { + "name": "process_schema_changes", "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 -%}", + "path": "macros/materializations/models/incremental/on_schema_change.sql", + "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", + "unique_id": "macro.dbt.process_schema_changes", + "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.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" + "macro.dbt.check_for_schema_changes", + "macro.dbt.sync_column_schemas" ] }, "description": "", @@ -5561,29 +6375,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.34869, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.551887, + "supported_languages": null }, - "macro.dbt.materialization_materialized_view_default": { - "name": "materialization_materialized_view_default", + "macro.dbt.can_clone_table": { + "name": "can_clone_table", "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" + "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": "", @@ -5594,25 +6399,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3523326, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.552036, + "supported_languages": null }, - "macro.dbt.materialized_view_setup": { - "name": "materialized_view_setup", + "macro.dbt.default__can_clone_table": { + "name": "default__can_clone_table", "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 %}", + "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": [ - "macro.dbt.load_cached_relation", - "macro.dbt.drop_relation_if_exists", - "macro.dbt.run_hooks" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5622,21 +6421,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.352605, + "created_at": 1728697972.5521028, "supported_languages": null }, - "macro.dbt.materialized_view_teardown": { - "name": "materialized_view_teardown", + "macro.dbt.create_or_replace_clone": { + "name": "create_or_replace_clone", "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 %}", + "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.drop_relation_if_exists", - "macro.dbt.run_hooks" + "macro.dbt.default__create_or_replace_clone" ] }, "description": "", @@ -5647,26 +6445,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3527815, + "created_at": 1728697972.552277, "supported_languages": null }, - "macro.dbt.materialized_view_get_build_sql": { - "name": "materialized_view_get_build_sql", + "macro.dbt.default__create_or_replace_clone": { + "name": "default__create_or_replace_clone", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/materialized_view.sql", - "original_file_path": "macros/materializations/models/materialized_view.sql", - "unique_id": "macro.dbt.materialized_view_get_build_sql", - "macro_sql": "{% macro materialized_view_get_build_sql(existing_relation, target_relation, backup_relation, intermediate_relation) %}\n\n {% set full_refresh_mode = should_full_refresh() %}\n\n -- determine the scenario we're in: create, full_refresh, alter, refresh data\n {% if existing_relation is none %}\n {% set build_sql = get_create_materialized_view_as_sql(target_relation, sql) %}\n {% elif full_refresh_mode or not existing_relation.is_materialized_view %}\n {% set build_sql = get_replace_sql(existing_relation, target_relation, sql) %}\n {% else %}\n\n -- get config options\n {% set on_configuration_change = config.get('on_configuration_change') %}\n {% set configuration_changes = get_materialized_view_configuration_changes(existing_relation, config) %}\n\n {% if configuration_changes is none %}\n {% set build_sql = refresh_materialized_view(target_relation) %}\n\n {% elif on_configuration_change == 'apply' %}\n {% set build_sql = get_alter_materialized_view_as_sql(target_relation, configuration_changes, sql, existing_relation, backup_relation, intermediate_relation) %}\n {% elif on_configuration_change == 'continue' %}\n {% set build_sql = '' %}\n {{ exceptions.warn(\"Configuration changes were identified and `on_configuration_change` was set to `continue` for `\" ~ target_relation ~ \"`\") }}\n {% elif on_configuration_change == 'fail' %}\n {{ exceptions.raise_fail_fast_error(\"Configuration changes were identified and `on_configuration_change` was set to `fail` for `\" ~ target_relation ~ \"`\") }}\n\n {% else %}\n -- this only happens if the user provides a value other than `apply`, 'skip', 'fail'\n {{ exceptions.raise_compiler_error(\"Unexpected configuration scenario\") }}\n\n {% endif %}\n\n {% endif %}\n\n {% do return(build_sql) %}\n\n{% endmacro %}", + "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": [ - "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" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5676,19 +6467,28 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3537242, + "created_at": 1728697972.552373, "supported_languages": null }, - "macro.dbt.materialized_view_execute_no_op": { - "name": "materialized_view_execute_no_op", + "macro.dbt.materialization_clone_default": { + "name": "materialization_clone_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.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 %}", + "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 {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation.render()) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", "depends_on": { - "macros": [] + "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": {}, @@ -5698,24 +6498,32 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3538854, - "supported_languages": null + "created_at": 1728697972.554504, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.materialized_view_execute_build_sql": { - "name": "materialized_view_execute_build_sql", + "macro.dbt.materialization_seed_default": { + "name": "materialization_seed_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.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 %}", + "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.statement", + "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.persist_docs", + "macro.dbt.create_indexes" ] }, "description": "", @@ -5726,19 +6534,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3543181, - "supported_languages": null + "created_at": 1728697972.5563571, + "supported_languages": [ + "sql" + ] }, - "macro.dbt.incremental_validate_on_schema_change": { - "name": "incremental_validate_on_schema_change", + "macro.dbt.create_csv_table": { + "name": "create_csv_table", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__create_csv_table" + ] }, "description": "", "meta": {}, @@ -5748,21 +6560,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.358612, + "created_at": 1728697972.559569, "supported_languages": null }, - "macro.dbt.check_for_schema_changes": { - "name": "check_for_schema_changes", + "macro.dbt.default__create_csv_table": { + "name": "default__create_csv_table", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/on_schema_change.sql", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", - "unique_id": "macro.dbt.check_for_schema_changes", - "macro_sql": "{% macro check_for_schema_changes(source_relation, target_relation) %}\n\n {% set schema_changed = False %}\n\n {%- set source_columns = adapter.get_columns_in_relation(source_relation) -%}\n {%- set target_columns = adapter.get_columns_in_relation(target_relation) -%}\n {%- set source_not_in_target = diff_columns(source_columns, target_columns) -%}\n {%- set target_not_in_source = diff_columns(target_columns, source_columns) -%}\n\n {% set new_target_types = diff_column_data_types(source_columns, target_columns) %}\n\n {% if source_not_in_target != [] %}\n {% set schema_changed = True %}\n {% elif target_not_in_source != [] or new_target_types != [] %}\n {% set schema_changed = True %}\n {% elif new_target_types != [] %}\n {% set schema_changed = True %}\n {% endif %}\n\n {% set changes_dict = {\n 'schema_changed': schema_changed,\n 'source_not_in_target': source_not_in_target,\n 'target_not_in_source': target_not_in_source,\n 'source_columns': source_columns,\n 'target_columns': target_columns,\n 'new_target_types': new_target_types\n } %}\n\n {% set msg %}\n In {{ target_relation }}:\n Schema changed: {{ schema_changed }}\n Source columns not in target: {{ source_not_in_target }}\n Target columns not in source: {{ target_not_in_source }}\n New column types: {{ new_target_types }}\n {% endset %}\n\n {% do log(msg) %}\n\n {{ return(changes_dict) }}\n\n{% endmacro %}", + "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.diff_columns", - "macro.dbt.diff_column_data_types" + "macro.dbt.statement" ] }, "description": "", @@ -5773,21 +6584,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.359635, + "created_at": 1728697972.5600781, "supported_languages": null }, - "macro.dbt.sync_column_schemas": { - "name": "sync_column_schemas", + "macro.dbt.reset_csv_table": { + "name": "reset_csv_table", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/on_schema_change.sql", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", - "unique_id": "macro.dbt.sync_column_schemas", - "macro_sql": "{% macro sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {%- set add_to_target_arr = schema_changes_dict['source_not_in_target'] -%}\n\n {%- if on_schema_change == 'append_new_columns'-%}\n {%- if add_to_target_arr | length > 0 -%}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, none) -%}\n {%- endif -%}\n\n {% elif on_schema_change == 'sync_all_columns' %}\n {%- set remove_from_target_arr = schema_changes_dict['target_not_in_source'] -%}\n {%- set new_target_types = schema_changes_dict['new_target_types'] -%}\n\n {% if add_to_target_arr | length > 0 or remove_from_target_arr | length > 0 %}\n {%- do alter_relation_add_remove_columns(target_relation, add_to_target_arr, remove_from_target_arr) -%}\n {% endif %}\n\n {% if new_target_types != [] %}\n {% for ntt in new_target_types %}\n {% set column_name = ntt['column_name'] %}\n {% set new_type = ntt['new_type'] %}\n {% do alter_column_type(target_relation, column_name, new_type) %}\n {% endfor %}\n {% endif %}\n\n {% endif %}\n\n {% set schema_change_message %}\n In {{ target_relation }}:\n Schema change approach: {{ on_schema_change }}\n Columns added: {{ add_to_target_arr }}\n Columns removed: {{ remove_from_target_arr }}\n Data types changed: {{ new_target_types }}\n {% endset %}\n\n {% do log(schema_change_message) %}\n\n{% endmacro %}", + "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.alter_relation_add_remove_columns", - "macro.dbt.alter_column_type" + "macro.dbt.default__reset_csv_table" ] }, "description": "", @@ -5798,21 +6608,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3606787, + "created_at": 1728697972.5602088, "supported_languages": null }, - "macro.dbt.process_schema_changes": { - "name": "process_schema_changes", + "macro.dbt.default__reset_csv_table": { + "name": "default__reset_csv_table", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/on_schema_change.sql", - "original_file_path": "macros/materializations/models/incremental/on_schema_change.sql", - "unique_id": "macro.dbt.process_schema_changes", - "macro_sql": "{% macro process_schema_changes(on_schema_change, source_relation, target_relation) %}\n\n {% if on_schema_change == 'ignore' %}\n\n {{ return({}) }}\n\n {% else %}\n\n {% set schema_changes_dict = check_for_schema_changes(source_relation, target_relation) %}\n\n {% if schema_changes_dict['schema_changed'] %}\n\n {% if on_schema_change == 'fail' %}\n\n {% set fail_msg %}\n The source and target schemas on this incremental model are out of sync!\n They can be reconciled in several ways:\n - set the `on_schema_change` config to either append_new_columns or sync_all_columns, depending on your situation.\n - Re-run the incremental model with `full_refresh: True` to update the target schema.\n - update the schema manually and re-run the process.\n\n Additional troubleshooting context:\n Source columns not in target: {{ schema_changes_dict['source_not_in_target'] }}\n Target columns not in source: {{ schema_changes_dict['target_not_in_source'] }}\n New column types: {{ schema_changes_dict['new_target_types'] }}\n {% endset %}\n\n {% do exceptions.raise_compiler_error(fail_msg) %}\n\n {# -- unless we ignore, run the sync operation per the config #}\n {% else %}\n\n {% do sync_column_schemas(on_schema_change, target_relation, schema_changes_dict) %}\n\n {% endif %}\n\n {% endif %}\n\n {{ return(schema_changes_dict['source_columns']) }}\n\n {% endif %}\n\n{% endmacro %}", + "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.check_for_schema_changes", - "macro.dbt.sync_column_schemas" + "macro.dbt.create_csv_table" ] }, "description": "", @@ -5823,20 +6632,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3613412, + "created_at": 1728697972.5604868, "supported_languages": null }, - "macro.dbt.get_merge_sql": { - "name": "get_merge_sql", + "macro.dbt.get_csv_sql": { + "name": "get_csv_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 %}", + "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_merge_sql" + "macro.dbt.default__get_csv_sql" ] }, "description": "", @@ -5847,22 +6656,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3666162, + "created_at": 1728697972.560599, "supported_languages": null }, - "macro.dbt.default__get_merge_sql": { - "name": "default__get_merge_sql", + "macro.dbt.default__get_csv_sql": { + "name": "default__get_csv_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/merge.sql", - "original_file_path": "macros/materializations/models/incremental/merge.sql", - "unique_id": "macro.dbt.default__get_merge_sql", - "macro_sql": "{% macro default__get_merge_sql(target, source, unique_key, dest_columns, incremental_predicates=none) -%}\n {%- set predicates = [] if incremental_predicates is none else [] + incremental_predicates -%}\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n {%- set merge_update_columns = config.get('merge_update_columns') -%}\n {%- set merge_exclude_columns = config.get('merge_exclude_columns') -%}\n {%- set update_columns = get_merge_update_columns(merge_update_columns, merge_exclude_columns, dest_columns) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not mapping and unique_key is not string %}\n {% for key in unique_key %}\n {% set this_key_match %}\n DBT_INTERNAL_SOURCE.{{ key }} = DBT_INTERNAL_DEST.{{ key }}\n {% endset %}\n {% do predicates.append(this_key_match) %}\n {% endfor %}\n {% else %}\n {% set unique_key_match %}\n DBT_INTERNAL_SOURCE.{{ unique_key }} = DBT_INTERNAL_DEST.{{ unique_key }}\n {% endset %}\n {% do predicates.append(unique_key_match) %}\n {% endif %}\n {% else %}\n {% do predicates.append('FALSE') %}\n {% endif %}\n\n {{ sql_header if sql_header is not none }}\n\n merge into {{ target }} as DBT_INTERNAL_DEST\n using {{ source }} as DBT_INTERNAL_SOURCE\n on {{\"(\" ~ predicates | join(\") and (\") ~ \")\"}}\n\n {% if unique_key %}\n when matched then update set\n {% for column_name in update_columns -%}\n {{ column_name }} = DBT_INTERNAL_SOURCE.{{ column_name }}\n {%- if not loop.last %}, {%- endif %}\n {%- endfor %}\n {% endif %}\n\n when not matched then insert\n ({{ dest_cols_csv }})\n values\n ({{ dest_cols_csv }})\n\n{% endmacro %}", + "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": [ - "macro.dbt.get_quoted_csv", - "macro.dbt.get_merge_update_columns" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5872,20 +6678,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3677595, + "created_at": 1728697972.560678, "supported_languages": null }, - "macro.dbt.get_delete_insert_merge_sql": { - "name": "get_delete_insert_merge_sql", + "macro.dbt.get_binding_char": { + "name": "get_binding_char", "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 %}", + "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_delete_insert_merge_sql" + "macro.dbt.default__get_binding_char" ] }, "description": "", @@ -5896,21 +6702,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3679504, + "created_at": 1728697972.560759, "supported_languages": null }, - "macro.dbt.default__get_delete_insert_merge_sql": { - "name": "default__get_delete_insert_merge_sql", + "macro.dbt.default__get_binding_char": { + "name": "default__get_binding_char", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/merge.sql", - "original_file_path": "macros/materializations/models/incremental/merge.sql", - "unique_id": "macro.dbt.default__get_delete_insert_merge_sql", - "macro_sql": "{% macro default__get_delete_insert_merge_sql(target, source, unique_key, dest_columns, incremental_predicates) -%}\n\n {%- set dest_cols_csv = get_quoted_csv(dest_columns | map(attribute=\"name\")) -%}\n\n {% if unique_key %}\n {% if unique_key is sequence and unique_key is not string %}\n delete from {{target }}\n using {{ source }}\n where (\n {% for key in unique_key %}\n {{ source }}.{{ key }} = {{ target }}.{{ key }}\n {{ \"and \" if not loop.last}}\n {% endfor %}\n {% if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {% endif %}\n );\n {% else %}\n delete from {{ target }}\n where (\n {{ unique_key }}) in (\n select ({{ unique_key }})\n from {{ source }}\n )\n {%- if incremental_predicates %}\n {% for predicate in incremental_predicates %}\n and {{ predicate }}\n {% endfor %}\n {%- endif -%};\n\n {% endif %}\n {% endif %}\n\n insert into {{ target }} ({{ dest_cols_csv }})\n (\n select {{ dest_cols_csv }}\n from {{ source }}\n )\n\n{%- endmacro %}", + "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": [ - "macro.dbt.get_quoted_csv" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5920,20 +6724,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3687513, + "created_at": 1728697972.5608242, "supported_languages": null }, - "macro.dbt.get_insert_overwrite_merge_sql": { - "name": "get_insert_overwrite_merge_sql", + "macro.dbt.get_batch_size": { + "name": "get_batch_size", "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 %}", + "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_insert_overwrite_merge_sql" + "macro.dbt.default__get_batch_size" ] }, "description": "", @@ -5944,21 +6748,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.368945, + "created_at": 1728697972.5609138, "supported_languages": null }, - "macro.dbt.default__get_insert_overwrite_merge_sql": { - "name": "default__get_insert_overwrite_merge_sql", + "macro.dbt.default__get_batch_size": { + "name": "default__get_batch_size", "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 %}", + "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": [ - "macro.dbt.get_quoted_csv" - ] + "macros": [] }, "description": "", "meta": {}, @@ -5968,17 +6770,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3695483, + "created_at": 1728697972.560982, "supported_languages": null }, - "macro.dbt.get_quoted_csv": { - "name": "get_quoted_csv", + "macro.dbt.get_seed_column_quoted_csv": { + "name": "get_seed_column_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 %}", + "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": [] }, @@ -5990,19 +6792,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.370936, + "created_at": 1728697972.561244, "supported_languages": null }, - "macro.dbt.diff_columns": { - "name": "diff_columns", + "macro.dbt.load_csv_rows": { + "name": "load_csv_rows", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__load_csv_rows" + ] }, "description": "", "meta": {}, @@ -6012,19 +6816,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.371306, + "created_at": 1728697972.5613482, "supported_languages": null }, - "macro.dbt.diff_column_data_types": { - "name": "diff_column_data_types", + "macro.dbt.default__load_csv_rows": { + "name": "default__load_csv_rows", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/column_helpers.sql", - "original_file_path": "macros/materializations/models/incremental/column_helpers.sql", - "unique_id": "macro.dbt.diff_column_data_types", - "macro_sql": "{% macro diff_column_data_types(source_columns, target_columns) %}\n\n {% set result = [] %}\n {% for sc in source_columns %}\n {% set tc = target_columns | selectattr(\"name\", \"equalto\", sc.name) | list | first %}\n {% if tc %}\n {% if sc.data_type != tc.data_type and not sc.can_expand_to(other_column=tc) %}\n {{ result.append( { 'column_name': tc.name, 'new_type': sc.data_type } ) }}\n {% endif %}\n {% endif %}\n {% endfor %}\n\n {{ return(result) }}\n\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.get_batch_size", + "macro.dbt.get_seed_column_quoted_csv", + "macro.dbt.get_binding_char" + ] }, "description": "", "meta": {}, @@ -6034,20 +6842,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.37176, + "created_at": 1728697972.562082, "supported_languages": null }, - "macro.dbt.get_merge_update_columns": { - "name": "get_merge_update_columns", + "macro.dbt.generate_alias_name": { + "name": "generate_alias_name", "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 %}", + "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__get_merge_update_columns" + "macro.dbt.default__generate_alias_name" ] }, "description": "", @@ -6058,17 +6866,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3719199, + "created_at": 1728697972.562339, "supported_languages": null }, - "macro.dbt.default__get_merge_update_columns": { - "name": "default__get_merge_update_columns", + "macro.dbt.default__generate_alias_name": { + "name": "default__generate_alias_name", "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 %}", + "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": [] }, @@ -6080,20 +6888,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3724, + "created_at": 1728697972.5625658, "supported_languages": null }, - "macro.dbt.is_incremental": { - "name": "is_incremental", + "macro.dbt.generate_schema_name": { + "name": "generate_schema_name", "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 %}", + "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.should_full_refresh" + "macro.dbt.default__generate_schema_name" ] }, "description": "", @@ -6104,36 +6912,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3728564, + "created_at": 1728697972.562901, "supported_languages": null }, - "macro.dbt.materialization_incremental_default": { - "name": "materialization_incremental_default", + "macro.dbt.default__generate_schema_name": { + "name": "default__generate_schema_name", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/incremental/incremental.sql", - "original_file_path": "macros/materializations/models/incremental/incremental.sql", - "unique_id": "macro.dbt.materialization_incremental_default", - "macro_sql": "{% materialization incremental, default -%}\n\n -- relations\n {%- set existing_relation = load_cached_relation(this) -%}\n {%- set target_relation = this.incorporate(type='table') -%}\n {%- set temp_relation = make_temp_relation(target_relation)-%}\n {%- set intermediate_relation = make_intermediate_relation(target_relation)-%}\n {%- set backup_relation_type = 'table' if existing_relation is none else existing_relation.type -%}\n {%- set backup_relation = make_backup_relation(target_relation, backup_relation_type) -%}\n\n -- configs\n {%- set unique_key = config.get('unique_key') -%}\n {%- set full_refresh_mode = (should_full_refresh() or existing_relation.is_view) -%}\n {%- set on_schema_change = incremental_validate_on_schema_change(config.get('on_schema_change'), default='ignore') -%}\n\n -- the temp_ and backup_ relations should not already exist in the database; get_relation\n -- will return None in that case. Otherwise, we get a relation that we can drop\n -- later, before we try to use this name for the current operation. This has to happen before\n -- BEGIN, in a separate transaction\n {%- set preexisting_intermediate_relation = load_cached_relation(intermediate_relation)-%}\n {%- set preexisting_backup_relation = load_cached_relation(backup_relation) -%}\n -- grab current tables grants config for comparision later on\n {% set grant_config = config.get('grants') %}\n {{ drop_relation_if_exists(preexisting_intermediate_relation) }}\n {{ drop_relation_if_exists(preexisting_backup_relation) }}\n\n {{ run_hooks(pre_hooks, inside_transaction=False) }}\n\n -- `BEGIN` happens here:\n {{ run_hooks(pre_hooks, inside_transaction=True) }}\n\n {% set to_drop = [] %}\n\n {% if existing_relation is none %}\n {% set build_sql = get_create_table_as_sql(False, target_relation, sql) %}\n {% elif full_refresh_mode %}\n {% set build_sql = get_create_table_as_sql(False, intermediate_relation, sql) %}\n {% set need_swap = true %}\n {% else %}\n {% do run_query(get_create_table_as_sql(True, temp_relation, sql)) %}\n {% do adapter.expand_target_column_types(\n from_relation=temp_relation,\n to_relation=target_relation) %}\n {#-- Process schema changes. Returns dict of changes if successful. Use source columns for upserting/merging --#}\n {% set dest_columns = process_schema_changes(on_schema_change, temp_relation, existing_relation) %}\n {% if not dest_columns %}\n {% set dest_columns = adapter.get_columns_in_relation(existing_relation) %}\n {% endif %}\n\n {#-- Get the incremental_strategy, the macro to use for the strategy, and build the sql --#}\n {% set incremental_strategy = config.get('incremental_strategy') or 'default' %}\n {% set incremental_predicates = config.get('predicates', none) or config.get('incremental_predicates', none) %}\n {% set strategy_sql_macro_func = adapter.get_incremental_strategy_macro(context, incremental_strategy) %}\n {% set strategy_arg_dict = ({'target_relation': target_relation, 'temp_relation': temp_relation, 'unique_key': unique_key, 'dest_columns': dest_columns, 'incremental_predicates': incremental_predicates }) %}\n {% set build_sql = strategy_sql_macro_func(strategy_arg_dict) %}\n\n {% endif %}\n\n {% call statement(\"main\") %}\n {{ build_sql }}\n {% endcall %}\n\n {% if need_swap %}\n {% do adapter.rename_relation(target_relation, backup_relation) %}\n {% do adapter.rename_relation(intermediate_relation, target_relation) %}\n {% do to_drop.append(backup_relation) %}\n {% endif %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n\n {% do persist_docs(target_relation, model) %}\n\n {% if existing_relation is none or existing_relation.is_view or should_full_refresh() %}\n {% do create_indexes(target_relation) %}\n {% endif %}\n\n {{ run_hooks(post_hooks, inside_transaction=True) }}\n\n -- `COMMIT` happens here\n {% do adapter.commit() %}\n\n {% for rel in to_drop %}\n {% do adapter.drop_relation(rel) %}\n {% endfor %}\n\n {{ run_hooks(post_hooks, inside_transaction=False) }}\n\n {{ return({'relations': [target_relation]}) }}\n\n{%- endmaterialization %}", + "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": [ - "macro.dbt.load_cached_relation", - "macro.dbt.make_temp_relation", - "macro.dbt.make_intermediate_relation", - "macro.dbt.make_backup_relation", - "macro.dbt.should_full_refresh", - "macro.dbt.incremental_validate_on_schema_change", - "macro.dbt.drop_relation_if_exists", - "macro.dbt.run_hooks", - "macro.dbt.get_create_table_as_sql", - "macro.dbt.run_query", - "macro.dbt.process_schema_changes", - "macro.dbt.statement", - "macro.dbt.should_revoke", - "macro.dbt.apply_grants", - "macro.dbt.persist_docs", - "macro.dbt.create_indexes" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6143,23 +6934,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3764365, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.563048, + "supported_languages": null }, - "macro.dbt.get_incremental_append_sql": { - "name": "get_incremental_append_sql", + "macro.dbt.generate_schema_name_for_env": { + "name": "generate_schema_name_for_env", "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 %}", + "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": [ - "macro.dbt.default__get_incremental_append_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6169,20 +6956,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.377127, + "created_at": 1728697972.563212, "supported_languages": null }, - "macro.dbt.default__get_incremental_append_sql": { - "name": "default__get_incremental_append_sql", + "macro.dbt.generate_database_name": { + "name": "generate_database_name", "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 %}", + "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.get_insert_into_sql" + "macro.dbt.default__generate_database_name" ] }, "description": "", @@ -6193,21 +6980,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3772814, + "created_at": 1728697972.5634549, "supported_languages": null }, - "macro.dbt.get_incremental_delete_insert_sql": { - "name": "get_incremental_delete_insert_sql", + "macro.dbt.default__generate_database_name": { + "name": "default__generate_database_name", "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 %}", + "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": [ - "macro.dbt.default__get_incremental_delete_insert_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6217,20 +7002,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3774025, + "created_at": 1728697972.56361, "supported_languages": null }, - "macro.dbt.default__get_incremental_delete_insert_sql": { - "name": "default__get_incremental_delete_insert_sql", + "macro.dbt.get_drop_sql": { + "name": "get_drop_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 %}", + "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.get_delete_insert_merge_sql" + "macro.dbt.default__get_drop_sql" ] }, "description": "", @@ -6241,20 +7026,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3775992, + "created_at": 1728697972.56412, "supported_languages": null }, - "macro.dbt.get_incremental_merge_sql": { - "name": "get_incremental_merge_sql", + "macro.dbt.default__get_drop_sql": { + "name": "default__get_drop_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 %}", + "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.default__get_incremental_merge_sql" + "macro.dbt.drop_view", + "macro.dbt.drop_table", + "macro.dbt.drop_materialized_view" ] }, "description": "", @@ -6265,20 +7052,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.377723, + "created_at": 1728697972.564332, "supported_languages": null }, - "macro.dbt.default__get_incremental_merge_sql": { - "name": "default__get_incremental_merge_sql", + "macro.dbt.drop_relation": { + "name": "drop_relation", "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 %}", + "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.get_merge_sql" + "macro.dbt.default__drop_relation" ] }, "description": "", @@ -6289,20 +7076,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3779154, + "created_at": 1728697972.564429, "supported_languages": null }, - "macro.dbt.get_incremental_insert_overwrite_sql": { - "name": "get_incremental_insert_overwrite_sql", + "macro.dbt.default__drop_relation": { + "name": "default__drop_relation", "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 %}", + "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.default__get_incremental_insert_overwrite_sql" + "macro.dbt.statement", + "macro.dbt.get_drop_sql" ] }, "description": "", @@ -6313,21 +7101,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3780475, + "created_at": 1728697972.564536, "supported_languages": null }, - "macro.dbt.default__get_incremental_insert_overwrite_sql": { - "name": "default__get_incremental_insert_overwrite_sql", + "macro.dbt.drop_relation_if_exists": { + "name": "drop_relation_if_exists", "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 %}", + "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": [ - "macro.dbt.get_insert_overwrite_merge_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6337,20 +7123,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3782184, + "created_at": 1728697972.564637, "supported_languages": null }, - "macro.dbt.get_incremental_default_sql": { - "name": "get_incremental_default_sql", + "macro.dbt.get_replace_sql": { + "name": "get_replace_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 %}", + "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_postgres.postgres__get_incremental_default_sql" + "macro.dbt.default__get_replace_sql" ] }, "description": "", @@ -6361,20 +7147,28 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.37834, + "created_at": 1728697972.565141, "supported_languages": null }, - "macro.dbt.default__get_incremental_default_sql": { - "name": "default__get_incremental_default_sql", + "macro.dbt.default__get_replace_sql": { + "name": "default__get_replace_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 %}", + "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_incremental_append_sql" + "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": "", @@ -6385,20 +7179,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3784401, + "created_at": 1728697972.565762, "supported_languages": null }, - "macro.dbt.get_insert_into_sql": { - "name": "get_insert_into_sql", + "macro.dbt.get_create_intermediate_sql": { + "name": "get_create_intermediate_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 %}", + "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.get_quoted_csv" + "macro.dbt.default__get_create_intermediate_sql" ] }, "description": "", @@ -6409,20 +7203,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3786352, + "created_at": 1728697972.565978, "supported_languages": null }, - "macro.dbt.can_clone_table": { - "name": "can_clone_table", + "macro.dbt.default__get_create_intermediate_sql": { + "name": "default__get_create_intermediate_sql", "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 %}", + "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.default__can_clone_table" + "macro.dbt.make_intermediate_relation", + "macro.dbt.get_drop_sql", + "macro.dbt.get_create_sql" ] }, "description": "", @@ -6433,19 +7229,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3788033, + "created_at": 1728697972.566112, "supported_languages": null }, - "macro.dbt.default__can_clone_table": { - "name": "default__can_clone_table", + "macro.dbt.drop_schema_named": { + "name": "drop_schema_named", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__drop_schema_named" + ] }, "description": "", "meta": {}, @@ -6455,21 +7253,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3788884, + "created_at": 1728697972.566262, "supported_languages": null }, - "macro.dbt.create_or_replace_clone": { - "name": "create_or_replace_clone", + "macro.dbt.default__drop_schema_named": { + "name": "default__drop_schema_named", "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 %}", + "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": [ - "macro.dbt.default__create_or_replace_clone" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6479,19 +7275,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3790886, + "created_at": 1728697972.566371, "supported_languages": null }, - "macro.dbt.default__create_or_replace_clone": { - "name": "default__create_or_replace_clone", + "macro.dbt.get_drop_backup_sql": { + "name": "get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/clone/create_or_replace_clone.sql", - "original_file_path": "macros/materializations/models/clone/create_or_replace_clone.sql", - "unique_id": "macro.dbt.default__create_or_replace_clone", - "macro_sql": "{% macro default__create_or_replace_clone(this_relation, defer_relation) %}\n create or replace table {{ this_relation }} clone {{ defer_relation }}\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.default__get_drop_backup_sql" + ] }, "description": "", "meta": {}, @@ -6501,27 +7299,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3791878, + "created_at": 1728697972.566547, "supported_languages": null }, - "macro.dbt.materialization_clone_default": { - "name": "materialization_clone_default", + "macro.dbt.default__get_drop_backup_sql": { + "name": "default__get_drop_backup_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/materializations/models/clone/clone.sql", - "original_file_path": "macros/materializations/models/clone/clone.sql", - "unique_id": "macro.dbt.materialization_clone_default", - "macro_sql": "{%- materialization clone, default -%}\n\n {%- set relations = {'relations': []} -%}\n\n {%- if not defer_relation -%}\n -- nothing to do\n {{ log(\"No relation found in state manifest for \" ~ model.unique_id, info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set existing_relation = load_cached_relation(this) -%}\n\n {%- if existing_relation and not flags.FULL_REFRESH -%}\n -- noop!\n {{ log(\"Relation \" ~ existing_relation ~ \" already exists\", info=True) }}\n {{ return(relations) }}\n {%- endif -%}\n\n {%- set other_existing_relation = load_cached_relation(defer_relation) -%}\n\n -- If this is a database that can do zero-copy cloning of tables, and the other relation is a table, then this will be a table\n -- Otherwise, this will be a view\n\n {% set can_clone_table = can_clone_table() %}\n\n {%- if other_existing_relation and other_existing_relation.type == 'table' and can_clone_table -%}\n\n {%- set target_relation = this.incorporate(type='table') -%}\n {% if existing_relation is not none and not existing_relation.is_table %}\n {{ log(\"Dropping relation \" ~ existing_relation ~ \" because it is of type \" ~ existing_relation.type) }}\n {{ drop_relation_if_exists(existing_relation) }}\n {% endif %}\n\n -- as a general rule, data platforms that can clone tables can also do atomic 'create or replace'\n {% call statement('main') %}\n {% if target_relation and defer_relation and target_relation == defer_relation %}\n {{ log(\"Target relation and defer relation are the same, skipping clone for relation: \" ~ target_relation) }}\n {% else %}\n {{ create_or_replace_clone(target_relation, defer_relation) }}\n {% endif %}\n\n {% endcall %}\n\n {% set should_revoke = should_revoke(existing_relation, full_refresh_mode=True) %}\n {% do apply_grants(target_relation, grant_config, should_revoke=should_revoke) %}\n {% do persist_docs(target_relation, model) %}\n\n {{ return({'relations': [target_relation]}) }}\n\n {%- else -%}\n\n {%- set target_relation = this.incorporate(type='view') -%}\n\n -- reuse the view materialization\n -- TODO: support actual dispatch for materialization macros\n -- Tracking ticket: https://github.com/dbt-labs/dbt-core/issues/7799\n {% set search_name = \"materialization_view_\" ~ adapter.type() %}\n {% if not search_name in context %}\n {% set search_name = \"materialization_view_default\" %}\n {% endif %}\n {% set materialization_macro = context[search_name] %}\n {% set relations = materialization_macro() %}\n {{ return(relations) }}\n\n {%- endif -%}\n\n{%- endmaterialization -%}", + "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.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" + "macro.dbt.make_backup_relation", + "macro.dbt.get_drop_sql" ] }, "description": "", @@ -6532,22 +7324,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3822072, - "supported_languages": [ - "sql" - ] + "created_at": 1728697972.566654, + "supported_languages": null }, - "macro.dbt.get_replace_sql": { - "name": "get_replace_sql", + "macro.dbt.get_rename_sql": { + "name": "get_rename_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 %}", + "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_replace_sql" + "macro.dbt.default__get_rename_sql" ] }, "description": "", @@ -6558,28 +7348,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3828874, + "created_at": 1728697972.567064, "supported_languages": null }, - "macro.dbt.default__get_replace_sql": { - "name": "default__get_replace_sql", + "macro.dbt.default__get_rename_sql": { + "name": "default__get_rename_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 %}", + "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_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" + "macro.dbt.get_rename_view_sql", + "macro.dbt.get_rename_table_sql", + "macro.dbt.get_rename_materialized_view_sql" ] }, "description": "", @@ -6590,20 +7374,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.38372, + "created_at": 1728697972.5672882, "supported_languages": null }, - "macro.dbt.drop_schema_named": { - "name": "drop_schema_named", + "macro.dbt.rename_relation": { + "name": "rename_relation", "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 %}", + "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__drop_schema_named" + "macro.dbt.default__rename_relation" ] }, "description": "", @@ -6614,19 +7398,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3839293, + "created_at": 1728697972.567397, "supported_languages": null }, - "macro.dbt.default__drop_schema_named": { - "name": "default__drop_schema_named", + "macro.dbt.default__rename_relation": { + "name": "default__rename_relation", "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 %}", + "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": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -6636,7 +7422,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3840783, + "created_at": 1728697972.567552, "supported_languages": null }, "macro.dbt.get_create_backup_sql": { @@ -6660,7 +7446,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3843377, + "created_at": 1728697972.5677629, "supported_languages": null }, "macro.dbt.default__get_create_backup_sql": { @@ -6686,20 +7472,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3845432, + "created_at": 1728697972.567992, "supported_languages": null }, - "macro.dbt.get_drop_sql": { - "name": "get_drop_sql", + "macro.dbt.get_create_sql": { + "name": "get_create_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", + "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_drop_sql" + "macro.dbt.default__get_create_sql" ] }, "description": "", @@ -6710,22 +7496,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3850708, + "created_at": 1728697972.568266, "supported_languages": null }, - "macro.dbt.default__get_drop_sql": { - "name": "default__get_drop_sql", + "macro.dbt.default__get_create_sql": { + "name": "default__get_create_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/drop.sql", - "original_file_path": "macros/relations/drop.sql", - "unique_id": "macro.dbt.default__get_drop_sql", - "macro_sql": "{%- macro default__get_drop_sql(relation) -%}\n\n {%- if relation.is_view -%}\n {{ drop_view(relation) }}\n\n {%- elif relation.is_table -%}\n {{ drop_table(relation) }}\n\n {%- elif relation.is_materialized_view -%}\n {{ drop_materialized_view(relation) }}\n\n {%- else -%}\n drop {{ relation.type }} if exists {{ relation }} cascade\n\n {%- endif -%}\n\n{%- endmacro -%}\n\n\n", + "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.drop_view", - "macro.dbt.drop_table", - "macro.dbt.drop_materialized_view" + "macro.dbt.get_create_view_as_sql", + "macro.dbt.get_create_table_as_sql", + "macro.dbt.get_create_materialized_view_as_sql" ] }, "description": "", @@ -6736,20 +7522,45 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3853216, + "created_at": 1728697972.568498, "supported_languages": null }, - "macro.dbt.drop_relation": { - "name": "drop_relation", + "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": 1728697972.5686789, + "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/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 %}", + "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.default__drop_relation" + "macro.dbt.make_intermediate_relation", + "macro.dbt.get_rename_sql" ] }, "description": "", @@ -6760,21 +7571,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.385625, + "created_at": 1728697972.568786, "supported_languages": null }, - "macro.dbt.default__drop_relation": { - "name": "default__drop_relation", + "macro.dbt.drop_materialized_view": { + "name": "drop_materialized_view", "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 %}", + "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.statement", - "macro.dbt.get_drop_sql" + "macro.dbt_postgres.postgres__drop_materialized_view" ] }, "description": "", @@ -6785,17 +7595,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3858013, + "created_at": 1728697972.568923, "supported_languages": null }, - "macro.dbt.drop_relation_if_exists": { - "name": "drop_relation_if_exists", + "macro.dbt.default__drop_materialized_view": { + "name": "default__drop_materialized_view", "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 %}", + "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": [] }, @@ -6807,20 +7617,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.385953, + "created_at": 1728697972.56899, "supported_languages": null }, - "macro.dbt.get_rename_sql": { - "name": "get_rename_sql", + "macro.dbt.get_replace_materialized_view_sql": { + "name": "get_replace_materialized_view_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", + "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_rename_sql" + "macro.dbt.default__get_replace_materialized_view_sql" ] }, "description": "", @@ -6831,23 +7641,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3866253, + "created_at": 1728697972.5691352, "supported_languages": null }, - "macro.dbt.default__get_rename_sql": { - "name": "default__get_rename_sql", + "macro.dbt.default__get_replace_materialized_view_sql": { + "name": "default__get_replace_materialized_view_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", + "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": [ - "macro.dbt.get_rename_view_sql", - "macro.dbt.get_rename_table_sql", - "macro.dbt.get_rename_materialized_view_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6857,20 +7663,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.386954, + "created_at": 1728697972.569213, "supported_languages": null }, - "macro.dbt.rename_relation": { - "name": "rename_relation", + "macro.dbt.refresh_materialized_view": { + "name": "refresh_materialized_view", "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 %}", + "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.default__rename_relation" + "macro.dbt_postgres.postgres__refresh_materialized_view" ] }, "description": "", @@ -6881,21 +7687,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3871055, + "created_at": 1728697972.569379, "supported_languages": null }, - "macro.dbt.default__rename_relation": { - "name": "default__rename_relation", + "macro.dbt.default__refresh_materialized_view": { + "name": "default__refresh_materialized_view", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/rename.sql", - "original_file_path": "macros/relations/rename.sql", - "unique_id": "macro.dbt.default__rename_relation", - "macro_sql": "{% macro default__rename_relation(from_relation, to_relation) -%}\n {% set target_name = adapter.quote_as_configured(to_relation.identifier, 'identifier') %}\n {% call statement('rename_relation') -%}\n alter table {{ from_relation }} rename to {{ target_name }}\n {%- endcall %}\n{% endmacro %}", + "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": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6905,20 +7709,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3873057, + "created_at": 1728697972.569448, "supported_languages": null }, - "macro.dbt.get_create_intermediate_sql": { - "name": "get_create_intermediate_sql", + "macro.dbt.get_rename_materialized_view_sql": { + "name": "get_rename_materialized_view_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", + "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.default__get_create_intermediate_sql" + "macro.dbt_postgres.postgres__get_rename_materialized_view_sql" ] }, "description": "", @@ -6929,23 +7733,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3876204, + "created_at": 1728697972.5695949, "supported_languages": null }, - "macro.dbt.default__get_create_intermediate_sql": { - "name": "default__get_create_intermediate_sql", + "macro.dbt.default__get_rename_materialized_view_sql": { + "name": "default__get_rename_materialized_view_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 -%}", + "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": [ - "macro.dbt.make_intermediate_relation", - "macro.dbt.get_drop_sql", - "macro.dbt.get_create_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -6955,20 +7755,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3878078, + "created_at": 1728697972.569671, "supported_languages": null }, - "macro.dbt.get_drop_backup_sql": { - "name": "get_drop_backup_sql", + "macro.dbt.get_alter_materialized_view_as_sql": { + "name": "get_alter_materialized_view_as_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", + "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.default__get_drop_backup_sql" + "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql" ] }, "description": "", @@ -6979,22 +7779,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.388049, + "created_at": 1728697972.570016, "supported_languages": null }, - "macro.dbt.default__get_drop_backup_sql": { - "name": "default__get_drop_backup_sql", + "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/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 -%}", + "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": [ - "macro.dbt.make_backup_relation", - "macro.dbt.get_drop_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7004,20 +7801,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.388207, + "created_at": 1728697972.570116, "supported_languages": null }, - "macro.dbt.get_create_sql": { - "name": "get_create_sql", + "macro.dbt.get_materialized_view_configuration_changes": { + "name": "get_materialized_view_configuration_changes", "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", + "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.default__get_create_sql" + "macro.dbt_postgres.postgres__get_materialized_view_configuration_changes" ] }, "description": "", @@ -7028,23 +7825,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3885717, + "created_at": 1728697972.5702631, "supported_languages": null }, - "macro.dbt.default__get_create_sql": { - "name": "default__get_create_sql", + "macro.dbt.default__get_materialized_view_configuration_changes": { + "name": "default__get_materialized_view_configuration_changes", "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 -%}", + "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": [ - "macro.dbt.get_create_view_as_sql", - "macro.dbt.get_create_table_as_sql", - "macro.dbt.get_create_materialized_view_as_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7054,20 +7847,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3889022, + "created_at": 1728697972.570341, "supported_languages": null }, - "macro.dbt.get_rename_intermediate_sql": { - "name": "get_rename_intermediate_sql", + "macro.dbt.get_create_materialized_view_as_sql": { + "name": "get_create_materialized_view_as_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", + "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.default__get_rename_intermediate_sql" + "macro.dbt_postgres.postgres__get_create_materialized_view_as_sql" ] }, "description": "", @@ -7078,22 +7871,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3891385, + "created_at": 1728697972.570494, "supported_languages": null }, - "macro.dbt.default__get_rename_intermediate_sql": { - "name": "default__get_rename_intermediate_sql", + "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/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 -%}", + "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": [ - "macro.dbt.make_intermediate_relation", - "macro.dbt.get_rename_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7103,7 +7893,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3892772, + "created_at": 1728697972.570569, "supported_languages": null }, "macro.dbt.get_table_columns_and_constraints": { @@ -7127,7 +7917,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.390146, + "created_at": 1728697972.571182, "supported_languages": null }, "macro.dbt.default__get_table_columns_and_constraints": { @@ -7151,7 +7941,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.390241, + "created_at": 1728697972.571247, "supported_languages": null }, "macro.dbt.table_columns_and_constraints": { @@ -7173,7 +7963,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3906329, + "created_at": 1728697972.571528, "supported_languages": null }, "macro.dbt.get_assert_columns_equivalent": { @@ -7197,7 +7987,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3907554, + "created_at": 1728697972.5716212, "supported_languages": null }, "macro.dbt.default__get_assert_columns_equivalent": { @@ -7221,7 +8011,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3908541, + "created_at": 1728697972.5716941, "supported_languages": null }, "macro.dbt.assert_columns_equivalent": { @@ -7247,7 +8037,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3917553, + "created_at": 1728697972.572414, "supported_languages": null }, "macro.dbt.format_columns": { @@ -7271,7 +8061,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3920245, + "created_at": 1728697972.572615, "supported_languages": null }, "macro.dbt.default__format_column": { @@ -7293,43 +8083,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3922553, + "created_at": 1728697972.572789, "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": 1718342580.3929133, - "supported_languages": null - }, - "macro.dbt.default__get_replace_view_sql": { - "name": "default__get_replace_view_sql", + "macro.dbt.drop_table": { + "name": "drop_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__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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__drop_table" + ] }, "description": "", "meta": {}, @@ -7339,27 +8107,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3930209, + "created_at": 1728697972.572928, "supported_languages": null }, - "macro.dbt.create_or_replace_view": { - "name": "create_or_replace_view", + "macro.dbt.default__drop_table": { + "name": "default__drop_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.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 %}", + "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": [ - "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" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7369,20 +8129,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3940003, + "created_at": 1728697972.572994, "supported_languages": null }, - "macro.dbt.handle_existing_table": { - "name": "handle_existing_table", + "macro.dbt.get_replace_table_sql": { + "name": "get_replace_table_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.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 %}", + "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.default__handle_existing_table" + "macro.dbt_postgres.postgres__get_replace_table_sql" ] }, "description": "", @@ -7393,17 +8153,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.394149, + "created_at": 1728697972.573144, "supported_languages": null }, - "macro.dbt.default__handle_existing_table": { - "name": "default__handle_existing_table", + "macro.dbt.default__get_replace_table_sql": { + "name": "default__get_replace_table_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__handle_existing_table", - "macro_sql": "{% macro default__handle_existing_table(full_refresh, old_relation) %}\n {{ log(\"Dropping relation \" ~ old_relation ~ \" because it is of type \" ~ old_relation.type) }}\n {{ adapter.drop_relation(old_relation) }}\n{% endmacro %}", + "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": [] }, @@ -7415,20 +8175,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3943112, + "created_at": 1728697972.5732212, "supported_languages": null }, - "macro.dbt.drop_view": { - "name": "drop_view", + "macro.dbt.get_rename_table_sql": { + "name": "get_rename_table_sql", "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 %}", + "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__drop_view" + "macro.dbt_postgres.postgres__get_rename_table_sql" ] }, "description": "", @@ -7439,17 +8199,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3944995, + "created_at": 1728697972.573368, "supported_languages": null }, - "macro.dbt.default__drop_view": { - "name": "default__drop_view", + "macro.dbt.default__get_rename_table_sql": { + "name": "default__get_rename_table_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/view/drop.sql", - "original_file_path": "macros/relations/view/drop.sql", - "unique_id": "macro.dbt.default__drop_view", - "macro_sql": "{% macro default__drop_view(relation) -%}\n drop view if exists {{ relation }} cascade\n{%- endmacro %}", + "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": [] }, @@ -7461,20 +8221,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3945858, + "created_at": 1728697972.5734441, "supported_languages": null }, - "macro.dbt.get_rename_view_sql": { - "name": "get_rename_view_sql", + "macro.dbt.get_create_table_as_sql": { + "name": "get_create_table_as_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 %}", + "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_postgres.postgres__get_rename_view_sql" + "macro.dbt.default__get_create_table_as_sql" ] }, "description": "", @@ -7485,19 +8245,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3947809, + "created_at": 1728697972.573946, "supported_languages": null }, - "macro.dbt.default__get_rename_view_sql": { - "name": "default__get_rename_view_sql", + "macro.dbt.default__get_create_table_as_sql": { + "name": "default__get_create_table_as_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 %}", + "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": [] + "macros": [ + "macro.dbt.create_table_as" + ] }, "description": "", "meta": {}, @@ -7507,20 +8269,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3948836, + "created_at": 1728697972.574038, "supported_languages": null }, - "macro.dbt.get_create_view_as_sql": { - "name": "get_create_view_as_sql", + "macro.dbt.create_table_as": { + "name": "create_table_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.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 %}", + "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.default__get_create_view_as_sql" + "macro.dbt_postgres.postgres__create_table_as" ] }, "description": "", @@ -7531,20 +8293,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.395251, + "created_at": 1728697972.5742562, "supported_languages": null }, - "macro.dbt.default__get_create_view_as_sql": { - "name": "default__get_create_view_as_sql", + "macro.dbt.default__create_table_as": { + "name": "default__create_table_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__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 %}", + "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.create_view_as" + "macro.dbt.get_assert_columns_equivalent", + "macro.dbt.get_table_columns_and_constraints", + "macro.dbt.get_select_subquery" ] }, "description": "", @@ -7555,21 +8319,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3954093, + "created_at": 1728697972.5746078, "supported_languages": null }, - "macro.dbt.create_view_as": { - "name": "create_view_as", + "macro.dbt.default__get_column_names": { + "name": "default__get_column_names", "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 %}", + "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": [ - "macro.dbt.default__create_view_as" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7579,20 +8341,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3955605, + "created_at": 1728697972.574848, "supported_languages": null }, - "macro.dbt.default__create_view_as": { - "name": "default__create_view_as", + "macro.dbt.get_select_subquery": { + "name": "get_select_subquery", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/view/create.sql", - "original_file_path": "macros/relations/view/create.sql", - "unique_id": "macro.dbt.default__create_view_as", - "macro_sql": "{% macro default__create_view_as(relation, sql) -%}\n {%- set sql_header = config.get('sql_header', none) -%}\n\n {{ sql_header if sql_header is not none }}\n create view {{ relation }}\n {% set contract_config = config.get('contract') %}\n {% if contract_config.enforced %}\n {{ get_assert_columns_equivalent(sql) }}\n {%- endif %}\n as (\n {{ sql }}\n );\n{%- endmacro %}", + "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.get_assert_columns_equivalent" + "macro.dbt.default__get_select_subquery" ] }, "description": "", @@ -7603,20 +8365,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3958857, + "created_at": 1728697972.574949, "supported_languages": null }, - "macro.dbt.get_replace_table_sql": { - "name": "get_replace_table_sql", + "macro.dbt.default__get_select_subquery": { + "name": "default__get_select_subquery", "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 %}", + "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_postgres.postgres__get_replace_table_sql" + "macro.dbt.default__get_column_names" ] }, "description": "", @@ -7627,19 +8389,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3960884, + "created_at": 1728697972.575043, "supported_languages": null }, - "macro.dbt.default__get_replace_table_sql": { - "name": "default__get_replace_table_sql", + "macro.dbt.drop_view": { + "name": "drop_view", "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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__drop_view" + ] }, "description": "", "meta": {}, @@ -7649,21 +8413,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.396198, + "created_at": 1728697972.5751832, "supported_languages": null }, - "macro.dbt.drop_table": { - "name": "drop_table", + "macro.dbt.default__drop_view": { + "name": "default__drop_view", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__drop_table" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7673,19 +8435,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3963864, + "created_at": 1728697972.575253, "supported_languages": null }, - "macro.dbt.default__drop_table": { - "name": "default__drop_table", + "macro.dbt.get_replace_view_sql": { + "name": "get_replace_view_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/table/drop.sql", - "original_file_path": "macros/relations/table/drop.sql", - "unique_id": "macro.dbt.default__drop_table", - "macro_sql": "{% macro default__drop_table(relation) -%}\n drop table if exists {{ relation }} cascade\n{%- endmacro %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__get_replace_view_sql" + ] }, "description": "", "meta": {}, @@ -7695,21 +8459,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3964798, + "created_at": 1728697972.575773, "supported_languages": null }, - "macro.dbt.get_rename_table_sql": { - "name": "get_rename_table_sql", + "macro.dbt.default__get_replace_view_sql": { + "name": "default__get_replace_view_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 %}", + "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": [ - "macro.dbt_postgres.postgres__get_rename_table_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7719,19 +8481,27 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3966832, + "created_at": 1728697972.575861, "supported_languages": null }, - "macro.dbt.default__get_rename_table_sql": { - "name": "default__get_rename_table_sql", + "macro.dbt.create_or_replace_view": { + "name": "create_or_replace_view", "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 %}", + "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": [] + "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": {}, @@ -7741,20 +8511,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3967948, + "created_at": 1728697972.57647, "supported_languages": null }, - "macro.dbt.get_create_table_as_sql": { - "name": "get_create_table_as_sql", + "macro.dbt.handle_existing_table": { + "name": "handle_existing_table", "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 %}", + "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__get_create_table_as_sql" + "macro.dbt.default__handle_existing_table" ] }, "description": "", @@ -7765,21 +8535,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3974288, + "created_at": 1728697972.576582, "supported_languages": null }, - "macro.dbt.default__get_create_table_as_sql": { - "name": "default__get_create_table_as_sql", + "macro.dbt.default__handle_existing_table": { + "name": "default__handle_existing_table", "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 %}", + "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": [ - "macro.dbt.create_table_as" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7789,20 +8557,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3975763, + "created_at": 1728697972.576712, "supported_languages": null }, - "macro.dbt.create_table_as": { - "name": "create_table_as", + "macro.dbt.get_rename_view_sql": { + "name": "get_rename_view_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.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 %}", + "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__create_table_as" + "macro.dbt_postgres.postgres__get_rename_view_sql" ] }, "description": "", @@ -7813,23 +8581,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3978734, + "created_at": 1728697972.5768719, "supported_languages": null }, - "macro.dbt.default__create_table_as": { - "name": "default__create_table_as", + "macro.dbt.default__get_rename_view_sql": { + "name": "default__get_rename_view_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__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 %}", + "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": [ - "macro.dbt.get_assert_columns_equivalent", - "macro.dbt.get_table_columns_and_constraints", - "macro.dbt.get_select_subquery" - ] + "macros": [] }, "description": "", "meta": {}, @@ -7839,19 +8603,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3983583, + "created_at": 1728697972.576959, "supported_languages": null }, - "macro.dbt.default__get_column_names": { - "name": "default__get_column_names", + "macro.dbt.get_create_view_as_sql": { + "name": "get_create_view_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_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 %}", + "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": [] + "macros": [ + "macro.dbt.default__get_create_view_as_sql" + ] }, "description": "", "meta": {}, @@ -7861,20 +8627,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.398689, + "created_at": 1728697972.577215, "supported_languages": null }, - "macro.dbt.get_select_subquery": { - "name": "get_select_subquery", + "macro.dbt.default__get_create_view_as_sql": { + "name": "default__get_create_view_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_select_subquery", - "macro_sql": "{% macro get_select_subquery(sql) %}\n {{ return(adapter.dispatch('get_select_subquery', 'dbt')(sql)) }}\n{% endmacro %}", + "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.default__get_select_subquery" + "macro.dbt.create_view_as" ] }, "description": "", @@ -7885,20 +8651,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3988178, + "created_at": 1728697972.577305, "supported_languages": null }, - "macro.dbt.default__get_select_subquery": { - "name": "default__get_select_subquery", + "macro.dbt.create_view_as": { + "name": "create_view_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__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 %}", + "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__get_column_names" + "macro.dbt.default__create_view_as" ] }, "description": "", @@ -7909,20 +8675,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3989472, + "created_at": 1728697972.5774028, "supported_languages": null }, - "macro.dbt.refresh_materialized_view": { - "name": "refresh_materialized_view", + "macro.dbt.default__create_view_as": { + "name": "default__create_view_as", "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 %}", + "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_postgres.postgres__refresh_materialized_view" + "macro.dbt.get_assert_columns_equivalent" ] }, "description": "", @@ -7933,17 +8699,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3991637, + "created_at": 1728697972.577713, "supported_languages": null }, - "macro.dbt.default__refresh_materialized_view": { - "name": "default__refresh_materialized_view", + "macro.dbt.default__test_relationships": { + "name": "default__test_relationships", "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 %}", + "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": [] }, @@ -7955,20 +8721,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3992572, + "created_at": 1728697972.577933, "supported_languages": null }, - "macro.dbt.get_replace_materialized_view_sql": { - "name": "get_replace_materialized_view_sql", + "macro.dbt.default__test_not_null": { + "name": "default__test_not_null", "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 %}", + "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.default__get_replace_materialized_view_sql" + "macro.dbt.should_store_failures" ] }, "description": "", @@ -7979,17 +8745,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3994532, + "created_at": 1728697972.5781, "supported_languages": null }, - "macro.dbt.default__get_replace_materialized_view_sql": { - "name": "default__get_replace_materialized_view_sql", + "macro.dbt.default__test_unique": { + "name": "default__test_unique", "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 %}", + "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": [] }, @@ -8001,21 +8767,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3996208, + "created_at": 1728697972.578248, "supported_languages": null }, - "macro.dbt.drop_materialized_view": { - "name": "drop_materialized_view", + "macro.dbt.default__test_accepted_values": { + "name": "default__test_accepted_values", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__drop_materialized_view" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8025,17 +8789,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.3998442, + "created_at": 1728697972.5785851, "supported_languages": null }, - "macro.dbt.default__drop_materialized_view": { - "name": "default__drop_materialized_view", + "macro.dbt.statement": { + "name": "statement", "resource_type": "macro", "package_name": "dbt", - "path": "macros/relations/materialized_view/drop.sql", - "original_file_path": "macros/relations/materialized_view/drop.sql", - "unique_id": "macro.dbt.default__drop_materialized_view", - "macro_sql": "{% macro default__drop_materialized_view(relation) -%}\n drop materialized view if exists {{ relation }} cascade\n{%- endmacro %}", + "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": [] }, @@ -8047,21 +8811,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4000444, + "created_at": 1728697972.579448, "supported_languages": null }, - "macro.dbt.get_rename_materialized_view_sql": { - "name": "get_rename_materialized_view_sql", + "macro.dbt.noop_statement": { + "name": "noop_statement", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__get_rename_materialized_view_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8071,19 +8833,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4002557, + "created_at": 1728697972.5797608, "supported_languages": null }, - "macro.dbt.default__get_rename_materialized_view_sql": { - "name": "default__get_rename_materialized_view_sql", + "macro.dbt.run_query": { + "name": "run_query", "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 %}", + "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": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -8093,21 +8857,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.400361, + "created_at": 1728697972.579927, "supported_languages": null }, - "macro.dbt.get_alter_materialized_view_as_sql": { - "name": "get_alter_materialized_view_as_sql", + "macro.dbt.convert_datetime": { + "name": "convert_datetime", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__get_alter_materialized_view_as_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8117,19 +8879,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4008403, + "created_at": 1728697972.581246, "supported_languages": null }, - "macro.dbt.default__get_alter_materialized_view_as_sql": { - "name": "default__get_alter_materialized_view_as_sql", + "macro.dbt.dates_in_range": { + "name": "dates_in_range", "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 %}", + "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": [] + "macros": [ + "macro.dbt.convert_datetime" + ] }, "description": "", "meta": {}, @@ -8139,20 +8903,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4009714, + "created_at": 1728697972.581859, "supported_languages": null }, - "macro.dbt.get_materialized_view_configuration_changes": { - "name": "get_materialized_view_configuration_changes", + "macro.dbt.partition_range": { + "name": "partition_range", "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 %}", + "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_postgres.postgres__get_materialized_view_configuration_changes" + "macro.dbt.dates_in_range" ] }, "description": "", @@ -8163,17 +8927,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4011824, + "created_at": 1728697972.582237, "supported_languages": null }, - "macro.dbt.default__get_materialized_view_configuration_changes": { - "name": "default__get_materialized_view_configuration_changes", + "macro.dbt.py_current_timestring": { + "name": "py_current_timestring", "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 %}", + "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": [] }, @@ -8185,20 +8949,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4012969, + "created_at": 1728697972.5823581, "supported_languages": null }, - "macro.dbt.get_create_materialized_view_as_sql": { - "name": "get_create_materialized_view_as_sql", + "macro.dbt.except": { + "name": "except", "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 %}", + "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_postgres.postgres__get_create_materialized_view_as_sql" + "macro.dbt.default__except" ] }, "description": "", @@ -8209,17 +8973,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4014933, + "created_at": 1728697972.582481, "supported_languages": null }, - "macro.dbt.default__get_create_materialized_view_as_sql": { - "name": "default__get_create_materialized_view_as_sql", + "macro.dbt.default__except": { + "name": "default__except", "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 %}", + "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": [] }, @@ -8231,19 +8995,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4016087, + "created_at": 1728697972.582525, "supported_languages": null }, - "macro.dbt.default__test_accepted_values": { - "name": "default__test_accepted_values", + "macro.dbt.get_intervals_between": { + "name": "get_intervals_between", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__get_intervals_between" + ] }, "description": "", "meta": {}, @@ -8253,20 +9019,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.402032, + "created_at": 1728697972.582956, "supported_languages": null }, - "macro.dbt.default__test_not_null": { - "name": "default__test_not_null", + "macro.dbt.default__get_intervals_between": { + "name": "default__get_intervals_between", "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 %}", + "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.should_store_failures" + "macro.dbt.statement", + "macro.dbt.datediff" ] }, "description": "", @@ -8277,19 +9044,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4022574, + "created_at": 1728697972.583261, "supported_languages": null }, - "macro.dbt.default__test_relationships": { - "name": "default__test_relationships", + "macro.dbt.date_spine": { + "name": "date_spine", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__date_spine" + ] }, "description": "", "meta": {}, @@ -8299,19 +9068,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4025815, + "created_at": 1728697972.583389, "supported_languages": null }, - "macro.dbt.default__test_unique": { - "name": "default__test_unique", + "macro.dbt.default__date_spine": { + "name": "default__date_spine", "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 %}", + "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": [] + "macros": [ + "macro.dbt.generate_series", + "macro.dbt.get_intervals_between", + "macro.dbt.dateadd" + ] }, "description": "", "meta": {}, @@ -8321,20 +9094,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.402771, + "created_at": 1728697972.583595, "supported_languages": null }, - "macro.dbt.listagg": { - "name": "listagg", + "macro.dbt.date": { + "name": "date", "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 %}", + "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_postgres.postgres__listagg" + "macro.dbt.default__date" ] }, "description": "", @@ -8345,17 +9118,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.403408, + "created_at": 1728697972.5837948, "supported_languages": null }, - "macro.dbt.default__listagg": { - "name": "default__listagg", + "macro.dbt.default__date": { + "name": "default__date", "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 %}", + "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": [] }, @@ -8367,20 +9140,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.403729, + "created_at": 1728697972.583956, "supported_languages": null }, - "macro.dbt.safe_cast": { - "name": "safe_cast", + "macro.dbt.replace": { + "name": "replace", "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 %}", + "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__safe_cast" + "macro.dbt.default__replace" ] }, "description": "", @@ -8391,17 +9164,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4039612, + "created_at": 1728697972.584152, "supported_languages": null }, - "macro.dbt.default__safe_cast": { - "name": "default__safe_cast", + "macro.dbt.default__replace": { + "name": "default__replace", "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 %}", + "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": [] }, @@ -8413,20 +9186,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4040687, + "created_at": 1728697972.5842519, "supported_languages": null }, - "macro.dbt.intersect": { - "name": "intersect", + "macro.dbt.concat": { + "name": "concat", "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 %}", + "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__intersect" + "macro.dbt.default__concat" ] }, "description": "", @@ -8437,17 +9210,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4042351, + "created_at": 1728697972.58439, "supported_languages": null }, - "macro.dbt.default__intersect": { - "name": "default__intersect", + "macro.dbt.default__concat": { + "name": "default__concat", "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 %}", + "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": [] }, @@ -8459,20 +9232,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4042993, + "created_at": 1728697972.58446, "supported_languages": null }, - "macro.dbt.except": { - "name": "except", + "macro.dbt.get_powers_of_two": { + "name": "get_powers_of_two", "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 %}", + "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__except" + "macro.dbt.default__get_powers_of_two" ] }, "description": "", @@ -8483,17 +9256,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.40446, + "created_at": 1728697972.584995, "supported_languages": null }, - "macro.dbt.default__except": { - "name": "default__except", + "macro.dbt.default__get_powers_of_two": { + "name": "default__get_powers_of_two", "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 %}", + "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": [] }, @@ -8505,20 +9278,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4045324, + "created_at": 1728697972.585472, "supported_languages": null }, - "macro.dbt.get_powers_of_two": { - "name": "get_powers_of_two", + "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.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 %}", + "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__get_powers_of_two" + "macro.dbt.default__generate_series" ] }, "description": "", @@ -8529,19 +9302,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4051785, + "created_at": 1728697972.585577, "supported_languages": null }, - "macro.dbt.default__get_powers_of_two": { - "name": "default__get_powers_of_two", + "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__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 %}", + "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": [] + "macros": [ + "macro.dbt.get_powers_of_two" + ] }, "description": "", "meta": {}, @@ -8551,20 +9326,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4054904, + "created_at": 1728697972.585859, "supported_languages": null }, - "macro.dbt.generate_series": { - "name": "generate_series", + "macro.dbt.length": { + "name": "length", "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 %}", + "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__generate_series" + "macro.dbt.default__length" ] }, "description": "", @@ -8575,21 +9350,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4056432, + "created_at": 1728697972.586007, "supported_languages": null }, - "macro.dbt.default__generate_series": { - "name": "default__generate_series", + "macro.dbt.default__length": { + "name": "default__length", "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 %}", + "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": [ - "macro.dbt.get_powers_of_two" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8599,20 +9372,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4060104, + "created_at": 1728697972.586066, "supported_languages": null }, - "macro.dbt.replace": { - "name": "replace", + "macro.dbt.dateadd": { + "name": "dateadd", "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 %}", + "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.default__replace" + "macro.dbt_postgres.postgres__dateadd" ] }, "description": "", @@ -8623,17 +9396,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.406244, + "created_at": 1728697972.586258, "supported_languages": null }, - "macro.dbt.default__replace": { - "name": "default__replace", + "macro.dbt.default__dateadd": { + "name": "default__dateadd", "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 %}", + "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": [] }, @@ -8645,20 +9418,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4064612, + "created_at": 1728697972.586348, "supported_languages": null }, - "macro.dbt.get_intervals_between": { - "name": "get_intervals_between", + "macro.dbt.intersect": { + "name": "intersect", "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 %}", + "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__get_intervals_between" + "macro.dbt.default__intersect" ] }, "description": "", @@ -8669,22 +9442,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.407037, + "created_at": 1728697972.586476, "supported_languages": null }, - "macro.dbt.default__get_intervals_between": { - "name": "default__get_intervals_between", + "macro.dbt.default__intersect": { + "name": "default__intersect", "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 %}", + "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": [ - "macro.dbt.statement", - "macro.dbt.datediff" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8694,20 +9464,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4074483, + "created_at": 1728697972.58652, "supported_languages": null }, - "macro.dbt.date_spine": { - "name": "date_spine", + "macro.dbt.escape_single_quotes": { + "name": "escape_single_quotes", "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 %}", + "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__date_spine" + "macro.dbt.default__escape_single_quotes" ] }, "description": "", @@ -8718,23 +9488,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.407618, + "created_at": 1728697972.586671, "supported_languages": null }, - "macro.dbt.default__date_spine": { - "name": "default__date_spine", + "macro.dbt.default__escape_single_quotes": { + "name": "default__escape_single_quotes", "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 %}", + "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": [ - "macro.dbt.generate_series", - "macro.dbt.get_intervals_between", - "macro.dbt.dateadd" - ] + "macros": [] }, "description": "", "meta": {}, @@ -8744,20 +9510,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4078748, + "created_at": 1728697972.586748, "supported_languages": null }, - "macro.dbt.hash": { - "name": "hash", + "macro.dbt.right": { + "name": "right", "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 %}", + "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__hash" + "macro.dbt.default__right" ] }, "description": "", @@ -8768,17 +9534,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4080522, + "created_at": 1728697972.586915, "supported_languages": null }, - "macro.dbt.default__hash": { - "name": "default__hash", + "macro.dbt.default__right": { + "name": "default__right", "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 %}", + "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": [] }, @@ -8790,20 +9556,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4081643, + "created_at": 1728697972.586992, "supported_languages": null }, - "macro.dbt.concat": { - "name": "concat", + "macro.dbt.listagg": { + "name": "listagg", "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 %}", + "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.default__concat" + "macro.dbt_postgres.postgres__listagg" ] }, "description": "", @@ -8814,17 +9580,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.408333, + "created_at": 1728697972.587376, "supported_languages": null }, - "macro.dbt.default__concat": { - "name": "default__concat", + "macro.dbt.default__listagg": { + "name": "default__listagg", "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 %}", + "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": [] }, @@ -8836,20 +9602,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4084208, + "created_at": 1728697972.587609, "supported_languages": null }, - "macro.dbt.cast": { - "name": "cast", + "macro.dbt.datediff": { + "name": "datediff", "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 %}", + "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.default__cast" + "macro.dbt_postgres.postgres__datediff" ] }, "description": "", @@ -8860,17 +9626,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4086204, + "created_at": 1728697972.587799, "supported_languages": null }, - "macro.dbt.default__cast": { - "name": "default__cast", + "macro.dbt.default__datediff": { + "name": "default__datediff", "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 %}", + "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": [] }, @@ -8882,20 +9648,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4087105, + "created_at": 1728697972.58789, "supported_languages": null }, - "macro.dbt.string_literal": { - "name": "string_literal", + "macro.dbt.safe_cast": { + "name": "safe_cast", "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", + "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__string_literal" + "macro.dbt.default__safe_cast" ] }, "description": "", @@ -8906,17 +9672,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4088778, + "created_at": 1728697972.5880508, "supported_languages": null }, - "macro.dbt.default__string_literal": { - "name": "default__string_literal", + "macro.dbt.default__safe_cast": { + "name": "default__safe_cast", "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 %}", + "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": [] }, @@ -8928,20 +9694,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4089541, + "created_at": 1728697972.588129, "supported_languages": null }, - "macro.dbt.type_string": { - "name": "type_string", + "macro.dbt.hash": { + "name": "hash", "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", + "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__type_string" + "macro.dbt.default__hash" ] }, "description": "", @@ -8952,17 +9718,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4098876, + "created_at": 1728697972.588274, "supported_languages": null }, - "macro.dbt.default__type_string": { - "name": "default__type_string", + "macro.dbt.default__hash": { + "name": "default__hash", "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 %}", + "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": [] }, @@ -8974,20 +9740,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4100478, + "created_at": 1728697972.588362, "supported_languages": null }, - "macro.dbt.type_timestamp": { - "name": "type_timestamp", + "macro.dbt.cast_bool_to_text": { + "name": "cast_bool_to_text", "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", + "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__type_timestamp" + "macro.dbt.default__cast_bool_to_text" ] }, "description": "", @@ -8998,17 +9764,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.410172, + "created_at": 1728697972.588501, "supported_languages": null }, - "macro.dbt.default__type_timestamp": { - "name": "default__type_timestamp", + "macro.dbt.default__cast_bool_to_text": { + "name": "default__cast_bool_to_text", "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 %}", + "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": [] }, @@ -9020,20 +9786,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.410291, + "created_at": 1728697972.588592, "supported_languages": null }, - "macro.dbt.type_float": { - "name": "type_float", + "macro.dbt.cast": { + "name": "cast", "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", + "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__type_float" + "macro.dbt.default__cast" ] }, "description": "", @@ -9044,17 +9810,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4104068, + "created_at": 1728697972.588743, "supported_languages": null }, - "macro.dbt.default__type_float": { - "name": "default__type_float", + "macro.dbt.default__cast": { + "name": "default__cast", "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 %}", + "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": [] }, @@ -9066,20 +9832,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.410532, + "created_at": 1728697972.588811, "supported_languages": null }, - "macro.dbt.type_numeric": { - "name": "type_numeric", + "macro.dbt.any_value": { + "name": "any_value", "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", + "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.default__type_numeric" + "macro.dbt_postgres.postgres__any_value" ] }, "description": "", @@ -9090,17 +9856,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.410649, + "created_at": 1728697972.588944, "supported_languages": null }, - "macro.dbt.default__type_numeric": { - "name": "default__type_numeric", + "macro.dbt.default__any_value": { + "name": "default__any_value", "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 %}", + "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": [] }, @@ -9112,20 +9878,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.410781, + "created_at": 1728697972.589011, "supported_languages": null }, - "macro.dbt.type_bigint": { - "name": "type_bigint", + "macro.dbt.position": { + "name": "position", "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", + "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__type_bigint" + "macro.dbt.default__position" ] }, "description": "", @@ -9136,17 +9902,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4108956, + "created_at": 1728697972.589164, "supported_languages": null }, - "macro.dbt.default__type_bigint": { - "name": "default__type_bigint", + "macro.dbt.default__position": { + "name": "default__position", "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 %}", + "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": [] }, @@ -9158,20 +9924,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4110038, + "created_at": 1728697972.589298, "supported_languages": null }, - "macro.dbt.type_int": { - "name": "type_int", + "macro.dbt.string_literal": { + "name": "string_literal", "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", + "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__type_int" + "macro.dbt.default__string_literal" ] }, "description": "", @@ -9182,17 +9948,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4111238, + "created_at": 1728697972.58943, "supported_languages": null }, - "macro.dbt.default__type_int": { - "name": "default__type_int", + "macro.dbt.default__string_literal": { + "name": "default__string_literal", "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", + "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": [] }, @@ -9204,20 +9970,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4112356, + "created_at": 1728697972.5894852, "supported_languages": null }, - "macro.dbt.type_boolean": { - "name": "type_boolean", + "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_boolean", - "macro_sql": "\n\n{%- macro type_boolean() -%}\n {{ return(adapter.dispatch('type_boolean', 'dbt')()) }}\n{%- endmacro -%}\n\n", + "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_boolean" + "macro.dbt.default__type_string" ] }, "description": "", @@ -9228,17 +9994,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.411347, + "created_at": 1728697972.590035, "supported_languages": null }, - "macro.dbt.default__type_boolean": { - "name": "default__type_boolean", + "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_boolean", - "macro_sql": "{%- macro default__type_boolean() -%}\n {{ return(api.Column.translate_type(\"boolean\")) }}\n{%- endmacro -%}\n\n", + "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": [] }, @@ -9250,20 +10016,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4116066, + "created_at": 1728697972.590111, "supported_languages": null }, - "macro.dbt.array_construct": { - "name": "array_construct", + "macro.dbt.type_timestamp": { + "name": "type_timestamp", "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 %}", + "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__array_construct" + "macro.dbt.default__type_timestamp" ] }, "description": "", @@ -9274,17 +10040,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4119425, + "created_at": 1728697972.5902, "supported_languages": null }, - "macro.dbt.default__array_construct": { - "name": "default__array_construct", + "macro.dbt.default__type_timestamp": { + "name": "default__type_timestamp", "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 %}", + "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": [] }, @@ -9296,20 +10062,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4121304, + "created_at": 1728697972.590283, "supported_languages": null }, - "macro.dbt.cast_bool_to_text": { - "name": "cast_bool_to_text", + "macro.dbt.type_float": { + "name": "type_float", "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 %}", + "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__cast_bool_to_text" + "macro.dbt.default__type_float" ] }, "description": "", @@ -9320,17 +10086,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4123318, + "created_at": 1728697972.590372, "supported_languages": null }, - "macro.dbt.default__cast_bool_to_text": { - "name": "default__cast_bool_to_text", + "macro.dbt.default__type_float": { + "name": "default__type_float", "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 %}", + "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": [] }, @@ -9342,20 +10108,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4124503, + "created_at": 1728697972.590455, "supported_languages": null }, - "macro.dbt.bool_or": { - "name": "bool_or", + "macro.dbt.type_numeric": { + "name": "type_numeric", "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 %}", + "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__bool_or" + "macro.dbt.default__type_numeric" ] }, "description": "", @@ -9366,17 +10132,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4126403, + "created_at": 1728697972.590544, "supported_languages": null }, - "macro.dbt.default__bool_or": { - "name": "default__bool_or", + "macro.dbt.default__type_numeric": { + "name": "default__type_numeric", "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 %}", + "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": [] }, @@ -9388,20 +10154,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4127219, + "created_at": 1728697972.59064, "supported_languages": null }, - "macro.dbt.dateadd": { - "name": "dateadd", + "macro.dbt.type_bigint": { + "name": "type_bigint", "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 %}", + "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_postgres.postgres__dateadd" + "macro.dbt.default__type_bigint" ] }, "description": "", @@ -9412,17 +10178,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.412981, + "created_at": 1728697972.590729, "supported_languages": null }, - "macro.dbt.default__dateadd": { - "name": "default__dateadd", + "macro.dbt.default__type_bigint": { + "name": "default__type_bigint", "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 %}", + "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": [] }, @@ -9434,20 +10200,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4131012, + "created_at": 1728697972.590812, "supported_languages": null }, - "macro.dbt.any_value": { - "name": "any_value", + "macro.dbt.type_int": { + "name": "type_int", "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 %}", + "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_postgres.postgres__any_value" + "macro.dbt.default__type_int" ] }, "description": "", @@ -9458,17 +10224,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.413281, + "created_at": 1728697972.5909, "supported_languages": null }, - "macro.dbt.default__any_value": { - "name": "default__any_value", + "macro.dbt.default__type_int": { + "name": "default__type_int", "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 %}", + "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": [] }, @@ -9480,20 +10246,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4133542, + "created_at": 1728697972.590981, "supported_languages": null }, - "macro.dbt.split_part": { - "name": "split_part", + "macro.dbt.type_boolean": { + "name": "type_boolean", "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 %}", + "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_postgres.postgres__split_part" + "macro.dbt.default__type_boolean" ] }, "description": "", @@ -9504,17 +10270,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4137516, + "created_at": 1728697972.591072, "supported_languages": null }, - "macro.dbt.default__split_part": { - "name": "default__split_part", + "macro.dbt.default__type_boolean": { + "name": "default__type_boolean", "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 %}", + "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": [] }, @@ -9526,19 +10292,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4138653, + "created_at": 1728697972.5911522, "supported_languages": null }, - "macro.dbt._split_part_negative": { - "name": "_split_part_negative", + "macro.dbt.array_concat": { + "name": "array_concat", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__array_concat" + ] }, "description": "", "meta": {}, @@ -9548,21 +10316,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4140205, + "created_at": 1728697972.5913112, "supported_languages": null }, - "macro.dbt.length": { - "name": "length", + "macro.dbt.default__array_concat": { + "name": "default__array_concat", "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 %}", + "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": [ - "macro.dbt.default__length" - ] + "macros": [] }, "description": "", "meta": {}, @@ -9572,19 +10338,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.414194, + "created_at": 1728697972.591392, "supported_languages": null }, - "macro.dbt.default__length": { - "name": "default__length", + "macro.dbt.bool_or": { + "name": "bool_or", "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 -%}", + "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": [] + "macros": [ + "macro.dbt.default__bool_or" + ] }, "description": "", "meta": {}, @@ -9594,21 +10362,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4142718, + "created_at": 1728697972.591533, "supported_languages": null }, - "macro.dbt.right": { - "name": "right", + "macro.dbt.default__bool_or": { + "name": "default__bool_or", "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 %}", + "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": [ - "macro.dbt.default__right" - ] + "macros": [] }, "description": "", "meta": {}, @@ -9618,19 +10384,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.414477, + "created_at": 1728697972.591591, "supported_languages": null }, - "macro.dbt.default__right": { - "name": "default__right", + "macro.dbt.last_day": { + "name": "last_day", "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 -%}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__last_day" + ] }, "description": "", "meta": {}, @@ -9640,20 +10408,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.414587, + "created_at": 1728697972.591788, "supported_languages": null }, - "macro.dbt.position": { - "name": "position", + "macro.dbt.default_last_day": { + "name": "default_last_day", "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 %}", + "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.default__position" + "macro.dbt.dateadd", + "macro.dbt.date_trunc" ] }, "description": "", @@ -9664,19 +10433,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4147823, + "created_at": 1728697972.591935, "supported_languages": null }, - "macro.dbt.default__position": { - "name": "default__position", + "macro.dbt.default__last_day": { + "name": "default__last_day", "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 -%}", + "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": [] + "macros": [ + "macro.dbt.default_last_day" + ] }, "description": "", "meta": {}, @@ -9686,20 +10457,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4148755, + "created_at": 1728697972.5920188, "supported_languages": null }, - "macro.dbt.date_trunc": { - "name": "date_trunc", + "macro.dbt.split_part": { + "name": "split_part", "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 %}", + "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.default__date_trunc" + "macro.dbt_postgres.postgres__split_part" ] }, "description": "", @@ -9710,17 +10481,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4150612, + "created_at": 1728697972.5923488, "supported_languages": null }, - "macro.dbt.default__date_trunc": { - "name": "default__date_trunc", + "macro.dbt.default__split_part": { + "name": "default__split_part", "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 %}", + "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": [] }, @@ -9732,21 +10503,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4151547, + "created_at": 1728697972.592448, "supported_languages": null }, - "macro.dbt.date": { - "name": "date", + "macro.dbt._split_part_negative": { + "name": "_split_part_negative", "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 %}", + "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": [ - "macro.dbt.default__date" - ] + "macros": [] }, "description": "", "meta": {}, @@ -9756,19 +10525,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4153864, + "created_at": 1728697972.592578, "supported_languages": null }, - "macro.dbt.default__date": { - "name": "default__date", + "macro.dbt.date_trunc": { + "name": "date_trunc", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__date_trunc" + ] }, "description": "", "meta": {}, @@ -9778,21 +10549,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4155967, + "created_at": 1728697972.592795, "supported_languages": null }, - "macro.dbt.last_day": { - "name": "last_day", + "macro.dbt.default__date_trunc": { + "name": "default__date_trunc", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__last_day" - ] + "macros": [] }, "description": "", "meta": {}, @@ -9802,21 +10571,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4158368, + "created_at": 1728697972.592872, "supported_languages": null }, - "macro.dbt.default_last_day": { - "name": "default_last_day", + "macro.dbt.array_construct": { + "name": "array_construct", "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", + "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.dateadd", - "macro.dbt.date_trunc" + "macro.dbt.default__array_construct" ] }, "description": "", @@ -9827,21 +10595,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4160984, + "created_at": 1728697972.5930848, "supported_languages": null }, - "macro.dbt.default__last_day": { - "name": "default__last_day", + "macro.dbt.default__array_construct": { + "name": "default__array_construct", "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 %}", + "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": [ - "macro.dbt.default_last_day" - ] + "macros": [] }, "description": "", "meta": {}, @@ -9851,20 +10617,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4162023, + "created_at": 1728697972.5932212, "supported_languages": null }, - "macro.dbt.escape_single_quotes": { - "name": "escape_single_quotes", + "macro.dbt.array_append": { + "name": "array_append", "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 %}", + "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__escape_single_quotes" + "macro.dbt.default__array_append" ] }, "description": "", @@ -9875,17 +10641,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4163883, + "created_at": 1728697972.593384, "supported_languages": null }, - "macro.dbt.default__escape_single_quotes": { - "name": "default__escape_single_quotes", + "macro.dbt.default__array_append": { + "name": "default__array_append", "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 %}", + "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": [] }, @@ -9897,20 +10663,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4164913, + "created_at": 1728697972.59346, "supported_languages": null }, - "macro.dbt.datediff": { - "name": "datediff", + "macro.dbt.create_schema": { + "name": "create_schema", "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 %}", + "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__datediff" + "macro.dbt_postgres.postgres__create_schema" ] }, "description": "", @@ -9921,19 +10687,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4167254, + "created_at": 1728697972.5936892, "supported_languages": null }, - "macro.dbt.default__datediff": { - "name": "default__datediff", + "macro.dbt.default__create_schema": { + "name": "default__create_schema", "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 %}", + "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": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -9943,20 +10711,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4168377, + "created_at": 1728697972.593793, "supported_languages": null }, - "macro.dbt.array_append": { - "name": "array_append", + "macro.dbt.drop_schema": { + "name": "drop_schema", "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 %}", + "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.default__array_append" + "macro.dbt_postgres.postgres__drop_schema" ] }, "description": "", @@ -9967,19 +10735,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.417031, + "created_at": 1728697972.5938811, "supported_languages": null }, - "macro.dbt.default__array_append": { - "name": "default__array_append", + "macro.dbt.default__drop_schema": { + "name": "default__drop_schema", "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 %}", + "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": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -9989,20 +10759,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4171221, + "created_at": 1728697972.5939798, "supported_languages": null }, - "macro.dbt.array_concat": { - "name": "array_concat", + "macro.dbt.current_timestamp": { + "name": "current_timestamp", "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 %}", + "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.default__array_concat" + "macro.dbt_postgres.postgres__current_timestamp" ] }, "description": "", @@ -10013,17 +10783,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4173093, + "created_at": 1728697972.594285, "supported_languages": null }, - "macro.dbt.default__array_concat": { - "name": "default__array_concat", + "macro.dbt.default__current_timestamp": { + "name": "default__current_timestamp", "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 %}", + "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": [] }, @@ -10035,22 +10805,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.417401, + "created_at": 1728697972.594368, "supported_languages": null }, - "macro.dbt.get_fixture_sql": { - "name": "get_fixture_sql", + "macro.dbt.snapshot_get_time": { + "name": "snapshot_get_time", "resource_type": "macro", "package_name": "dbt", - "path": "macros/unit_test_sql/get_fixture_sql.sql", - "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", - "unique_id": "macro.dbt.get_fixture_sql", - "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\n{%- set default_row_copy = default_row.copy() -%}\n{%- do default_row_copy.update(formatted_row) -%}\nselect\n{%- for column_name, column_value in default_row_copy.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", + "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.load_relation", - "macro.dbt.safe_cast", - "macro.dbt.format_row" + "macro.dbt_postgres.postgres__snapshot_get_time" ] }, "description": "", @@ -10061,20 +10829,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.420144, + "created_at": 1728697972.59445, "supported_languages": null }, - "macro.dbt.get_expected_sql": { - "name": "get_expected_sql", + "macro.dbt.default__snapshot_get_time": { + "name": "default__snapshot_get_time", "resource_type": "macro", "package_name": "dbt", - "path": "macros/unit_test_sql/get_fixture_sql.sql", - "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", - "unique_id": "macro.dbt.get_expected_sql", - "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", + "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.format_row" + "macro.dbt.current_timestamp" ] }, "description": "", @@ -10085,22 +10853,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.420575, + "created_at": 1728697972.594508, "supported_languages": null }, - "macro.dbt.format_row": { - "name": "format_row", + "macro.dbt.current_timestamp_backcompat": { + "name": "current_timestamp_backcompat", "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 -%}", + "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.string_literal", - "macro.dbt.escape_single_quotes", - "macro.dbt.safe_cast" + "macro.dbt_postgres.postgres__current_timestamp_backcompat" ] }, "description": "", @@ -10111,17 +10877,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.42135, + "created_at": 1728697972.5946, "supported_languages": null }, - "macro.dbt.convert_datetime": { - "name": "convert_datetime", + "macro.dbt.default__current_timestamp_backcompat": { + "name": "default__current_timestamp_backcompat", "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 %}", + "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": [] }, @@ -10133,20 +10899,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4227633, + "created_at": 1728697972.594645, "supported_languages": null }, - "macro.dbt.dates_in_range": { - "name": "dates_in_range", + "macro.dbt.current_timestamp_in_utc_backcompat": { + "name": "current_timestamp_in_utc_backcompat", "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 %}", + "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.convert_datetime" + "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat" ] }, "description": "", @@ -10157,20 +10923,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.423555, + "created_at": 1728697972.594738, "supported_languages": null }, - "macro.dbt.partition_range": { - "name": "partition_range", + "macro.dbt.default__current_timestamp_in_utc_backcompat": { + "name": "default__current_timestamp_in_utc_backcompat", "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 %}", + "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.dates_in_range" + "macro.dbt.current_timestamp_backcompat", + "macro.dbt_postgres.postgres__current_timestamp_backcompat" ] }, "description": "", @@ -10181,19 +10948,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4240794, + "created_at": 1728697972.59483, "supported_languages": null }, - "macro.dbt.py_current_timestring": { - "name": "py_current_timestring", + "macro.dbt.get_create_index_sql": { + "name": "get_create_index_sql", "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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__get_create_index_sql" + ] }, "description": "", "meta": {}, @@ -10203,17 +10972,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4242406, + "created_at": 1728697972.5953548, "supported_languages": null }, - "macro.dbt.statement": { - "name": "statement", + "macro.dbt.default__get_create_index_sql": { + "name": "default__get_create_index_sql", "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 %}", + "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": [] }, @@ -10225,19 +10994,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4252777, + "created_at": 1728697972.595433, "supported_languages": null }, - "macro.dbt.noop_statement": { - "name": "noop_statement", + "macro.dbt.create_indexes": { + "name": "create_indexes", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__create_indexes" + ] }, "description": "", "meta": {}, @@ -10247,20 +11018,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4256752, + "created_at": 1728697972.5955179, "supported_languages": null }, - "macro.dbt.run_query": { - "name": "run_query", + "macro.dbt.default__create_indexes": { + "name": "default__create_indexes", "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 %}", + "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.statement" + "macro.dbt.get_create_index_sql", + "macro.dbt.run_query" ] }, "description": "", @@ -10271,20 +11043,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4258752, + "created_at": 1728697972.595733, "supported_languages": null }, - "macro.dbt.current_timestamp": { - "name": "current_timestamp", + "macro.dbt.get_drop_index_sql": { + "name": "get_drop_index_sql", "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", + "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__current_timestamp" + "macro.dbt_postgres.postgres__get_drop_index_sql" ] }, "description": "", @@ -10295,17 +11067,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4262376, + "created_at": 1728697972.595839, "supported_languages": null }, - "macro.dbt.default__current_timestamp": { - "name": "default__current_timestamp", + "macro.dbt.default__get_drop_index_sql": { + "name": "default__get_drop_index_sql", "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 %}", + "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": [] }, @@ -10317,20 +11089,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4263422, + "created_at": 1728697972.5959291, "supported_languages": null }, - "macro.dbt.snapshot_get_time": { - "name": "snapshot_get_time", + "macro.dbt.get_show_indexes_sql": { + "name": "get_show_indexes_sql", "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", + "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__snapshot_get_time" + "macro.dbt_postgres.postgres__get_show_indexes_sql" ] }, "description": "", @@ -10341,21 +11113,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4264402, + "created_at": 1728697972.5960162, "supported_languages": null }, - "macro.dbt.default__snapshot_get_time": { - "name": "default__snapshot_get_time", + "macro.dbt.default__get_show_indexes_sql": { + "name": "default__get_show_indexes_sql", "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 %}", + "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": [ - "macro.dbt.current_timestamp" - ] + "macros": [] }, "description": "", "meta": {}, @@ -10365,20 +11135,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4265125, + "created_at": 1728697972.5960891, "supported_languages": null }, - "macro.dbt.current_timestamp_backcompat": { - "name": "current_timestamp_backcompat", + "macro.dbt.make_intermediate_relation": { + "name": "make_intermediate_relation", "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 %}", + "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__current_timestamp_backcompat" + "macro.dbt_postgres.postgres__make_intermediate_relation" ] }, "description": "", @@ -10389,19 +11159,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4266527, + "created_at": 1728697972.597478, "supported_languages": null }, - "macro.dbt.default__current_timestamp_backcompat": { - "name": "default__current_timestamp_backcompat", + "macro.dbt.default__make_intermediate_relation": { + "name": "default__make_intermediate_relation", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__make_temp_relation" + ] }, "description": "", "meta": {}, @@ -10411,20 +11183,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4267845, + "created_at": 1728697972.597574, "supported_languages": null }, - "macro.dbt.current_timestamp_in_utc_backcompat": { - "name": "current_timestamp_in_utc_backcompat", + "macro.dbt.make_temp_relation": { + "name": "make_temp_relation", "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 %}", + "path": "macros/adapters/relation.sql", + "original_file_path": "macros/adapters/relation.sql", + "unique_id": "macro.dbt.make_temp_relation", + "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt_postgres.postgres__current_timestamp_in_utc_backcompat" + "macro.dbt_postgres.postgres__make_temp_relation" ] }, "description": "", @@ -10435,22 +11207,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4268987, + "created_at": 1728697972.597693, "supported_languages": null }, - "macro.dbt.default__current_timestamp_in_utc_backcompat": { - "name": "default__current_timestamp_in_utc_backcompat", + "macro.dbt.default__make_temp_relation": { + "name": "default__make_temp_relation", "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 %}", + "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": [ - "macro.dbt.current_timestamp_backcompat", - "macro.dbt_postgres.postgres__current_timestamp_backcompat" - ] + "macros": [] }, "description": "", "meta": {}, @@ -10460,20 +11229,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4270122, + "created_at": 1728697972.597853, "supported_languages": null }, - "macro.dbt.create_schema": { - "name": "create_schema", + "macro.dbt.make_backup_relation": { + "name": "make_backup_relation", "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 %}", + "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__create_schema" + "macro.dbt_postgres.postgres__make_backup_relation" ] }, "description": "", @@ -10484,21 +11253,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4272735, + "created_at": 1728697972.5979881, "supported_languages": null }, - "macro.dbt.default__create_schema": { - "name": "default__create_schema", + "macro.dbt.default__make_backup_relation": { + "name": "default__make_backup_relation", "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 %}", + "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": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "meta": {}, @@ -10508,20 +11275,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.427396, + "created_at": 1728697972.598164, "supported_languages": null }, - "macro.dbt.drop_schema": { - "name": "drop_schema", + "macro.dbt.truncate_relation": { + "name": "truncate_relation", "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 %}", + "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_postgres.postgres__drop_schema" + "macro.dbt.default__truncate_relation" ] }, "description": "", @@ -10532,17 +11299,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4275029, + "created_at": 1728697972.598264, "supported_languages": null }, - "macro.dbt.default__drop_schema": { - "name": "default__drop_schema", + "macro.dbt.default__truncate_relation": { + "name": "default__truncate_relation", "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 %}", + "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" @@ -10556,20 +11323,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4276319, + "created_at": 1728697972.598363, "supported_languages": null }, - "macro.dbt.alter_column_comment": { - "name": "alter_column_comment", + "macro.dbt.get_or_create_relation": { + "name": "get_or_create_relation", "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 %}", + "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_postgres.postgres__alter_column_comment" + "macro.dbt.default__get_or_create_relation" ] }, "description": "", @@ -10580,17 +11347,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4281182, + "created_at": 1728697972.598497, "supported_languages": null }, - "macro.dbt.default__alter_column_comment": { - "name": "default__alter_column_comment", + "macro.dbt.default__get_or_create_relation": { + "name": "default__get_or_create_relation", "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 %}", + "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": [] }, @@ -10602,41 +11369,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.428232, - "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": 1718342580.428367, + "created_at": 1728697972.5988, "supported_languages": null }, - "macro.dbt.default__alter_relation_comment": { - "name": "default__alter_relation_comment", + "macro.dbt.load_cached_relation": { + "name": "load_cached_relation", "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 %}", + "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": [] }, @@ -10648,20 +11391,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4285026, + "created_at": 1728697972.5989308, "supported_languages": null }, - "macro.dbt.persist_docs": { - "name": "persist_docs", + "macro.dbt.load_relation": { + "name": "load_relation", "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 %}", + "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.default__persist_docs" + "macro.dbt.load_cached_relation" ] }, "description": "", @@ -10672,22 +11415,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.428688, + "created_at": 1728697972.59901, "supported_languages": null }, - "macro.dbt.default__persist_docs": { - "name": "default__persist_docs", + "macro.dbt.collect_freshness": { + "name": "collect_freshness", "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 %}", + "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.run_query", - "macro.dbt.alter_relation_comment", - "macro.dbt.alter_column_comment" + "macro.dbt.default__collect_freshness" ] }, "description": "", @@ -10698,20 +11439,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4290164, + "created_at": 1728697972.599255, "supported_languages": null - }, - "macro.dbt.get_show_sql": { - "name": "get_show_sql", + }, + "macro.dbt.default__collect_freshness": { + "name": "default__collect_freshness", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/show.sql", - "original_file_path": "macros/adapters/show.sql", - "unique_id": "macro.dbt.get_show_sql", - "macro_sql": "{% macro get_show_sql(compiled_code, sql_header, limit) -%}\n {%- if sql_header -%}\n {{ sql_header }}\n {%- endif -%}\n {%- if limit is not none -%}\n {{ get_limit_subquery_sql(compiled_code, limit) }}\n {%- else -%}\n {{ compiled_code }}\n {%- endif -%}\n{% endmacro %}", + "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.get_limit_subquery_sql" + "macro.dbt.statement", + "macro.dbt.current_timestamp" ] }, "description": "", @@ -10722,20 +11464,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4293878, + "created_at": 1728697972.5994859, "supported_languages": null }, - "macro.dbt.get_limit_subquery_sql": { - "name": "get_limit_subquery_sql", + "macro.dbt.validate_sql": { + "name": "validate_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/show.sql", - "original_file_path": "macros/adapters/show.sql", - "unique_id": "macro.dbt.get_limit_subquery_sql", - "macro_sql": "{% macro get_limit_subquery_sql(sql, limit) %}\n {{ adapter.dispatch('get_limit_subquery_sql', 'dbt')(sql, limit) }}\n{% endmacro %}", + "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__get_limit_subquery_sql" + "macro.dbt.default__validate_sql" ] }, "description": "", @@ -10746,19 +11488,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4295487, + "created_at": 1728697972.599652, "supported_languages": null }, - "macro.dbt.default__get_limit_subquery_sql": { - "name": "default__get_limit_subquery_sql", + "macro.dbt.default__validate_sql": { + "name": "default__validate_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/show.sql", - "original_file_path": "macros/adapters/show.sql", - "unique_id": "macro.dbt.default__get_limit_subquery_sql", - "macro_sql": "{% macro default__get_limit_subquery_sql(sql, limit) %}\n select *\n from (\n {{ sql }}\n ) as model_limit_subq\n limit {{ limit }}\n{% endmacro %}", + "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": [] + "macros": [ + "macro.dbt.statement" + ] }, "description": "", "meta": {}, @@ -10768,20 +11512,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4296458, + "created_at": 1728697972.599782, "supported_languages": null }, - "macro.dbt.get_catalog_relations": { - "name": "get_catalog_relations", + "macro.dbt.copy_grants": { + "name": "copy_grants", "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 %}", + "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__get_catalog_relations" + "macro.dbt_postgres.postgres__copy_grants" ] }, "description": "", @@ -10792,17 +11536,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4320412, + "created_at": 1728697972.6009269, "supported_languages": null }, - "macro.dbt.default__get_catalog_relations": { - "name": "default__get_catalog_relations", + "macro.dbt.default__copy_grants": { + "name": "default__copy_grants", "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 %}", + "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": [] }, @@ -10814,20 +11558,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.432248, + "created_at": 1728697972.600993, "supported_languages": null }, - "macro.dbt.get_catalog": { - "name": "get_catalog", + "macro.dbt.support_multiple_grantees_per_dcl_statement": { + "name": "support_multiple_grantees_per_dcl_statement", "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 %}", + "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_postgres.postgres__get_catalog" + "macro.dbt.default__support_multiple_grantees_per_dcl_statement" ] }, "description": "", @@ -10838,17 +11582,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.432404, + "created_at": 1728697972.601089, "supported_languages": null }, - "macro.dbt.default__get_catalog": { - "name": "default__get_catalog", + "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/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 %}", + "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": [] }, @@ -10860,20 +11604,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4325964, + "created_at": 1728697972.601155, "supported_languages": null }, - "macro.dbt.information_schema_name": { - "name": "information_schema_name", + "macro.dbt.should_revoke": { + "name": "should_revoke", "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 %}", + "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_postgres.postgres__information_schema_name" + "macro.dbt.copy_grants" ] }, "description": "", @@ -10884,19 +11628,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4327369, + "created_at": 1728697972.601345, "supported_languages": null }, - "macro.dbt.default__information_schema_name": { - "name": "default__information_schema_name", + "macro.dbt.get_show_grant_sql": { + "name": "get_show_grant_sql", "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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__get_show_grant_sql" + ] }, "description": "", "meta": {}, @@ -10906,21 +11652,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4328551, + "created_at": 1728697972.601454, "supported_languages": null }, - "macro.dbt.list_schemas": { - "name": "list_schemas", + "macro.dbt.default__get_show_grant_sql": { + "name": "default__get_show_grant_sql", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__list_schemas" - ] + "macros": [] }, "description": "", "meta": {}, @@ -10930,21 +11674,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4329782, + "created_at": 1728697972.601521, "supported_languages": null }, - "macro.dbt.default__list_schemas": { - "name": "default__list_schemas", + "macro.dbt.get_grant_sql": { + "name": "get_grant_sql", "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 %}", + "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.information_schema_name", - "macro.dbt.run_query" + "macro.dbt.default__get_grant_sql" ] }, "description": "", @@ -10955,21 +11698,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4331527, + "created_at": 1728697972.6016471, "supported_languages": null }, - "macro.dbt.check_schema_exists": { - "name": "check_schema_exists", + "macro.dbt.default__get_grant_sql": { + "name": "default__get_grant_sql", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__check_schema_exists" - ] + "macros": [] }, "description": "", "meta": {}, @@ -10979,21 +11720,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4332967, + "created_at": 1728697972.601763, "supported_languages": null }, - "macro.dbt.default__check_schema_exists": { - "name": "default__check_schema_exists", + "macro.dbt.get_revoke_sql": { + "name": "get_revoke_sql", "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 %}", + "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.replace", - "macro.dbt.run_query" + "macro.dbt.default__get_revoke_sql" ] }, "description": "", @@ -11004,21 +11744,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.433508, + "created_at": 1728697972.601886, "supported_languages": null }, - "macro.dbt.list_relations_without_caching": { - "name": "list_relations_without_caching", + "macro.dbt.default__get_revoke_sql": { + "name": "default__get_revoke_sql", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__list_relations_without_caching" - ] + "macros": [] }, "description": "", "meta": {}, @@ -11028,19 +11766,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4337533, + "created_at": 1728697972.6020632, "supported_languages": null }, - "macro.dbt.default__list_relations_without_caching": { - "name": "default__list_relations_without_caching", + "macro.dbt.get_dcl_statement_list": { + "name": "get_dcl_statement_list", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__get_dcl_statement_list" + ] }, "description": "", "meta": {}, @@ -11050,20 +11790,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4338777, + "created_at": 1728697972.6021912, "supported_languages": null }, - "macro.dbt.get_relations": { - "name": "get_relations", + "macro.dbt.default__get_dcl_statement_list": { + "name": "default__get_dcl_statement_list", "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 %}", + "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_postgres.postgres__get_relations" + "macro.dbt.support_multiple_grantees_per_dcl_statement" ] }, "description": "", @@ -11074,19 +11814,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4340005, + "created_at": 1728697972.602544, "supported_languages": null }, - "macro.dbt.default__get_relations": { - "name": "default__get_relations", + "macro.dbt.call_dcl_statements": { + "name": "call_dcl_statements", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__call_dcl_statements" + ] }, "description": "", "meta": {}, @@ -11096,20 +11838,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4341094, + "created_at": 1728697972.602644, "supported_languages": null }, - "macro.dbt.get_relation_last_modified": { - "name": "get_relation_last_modified", + "macro.dbt.default__call_dcl_statements": { + "name": "default__call_dcl_statements", "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 %}", + "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.default__get_relation_last_modified" + "macro.dbt.statement" ] }, "description": "", @@ -11120,19 +11862,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.434242, + "created_at": 1728697972.602777, "supported_languages": null }, - "macro.dbt.default__get_relation_last_modified": { - "name": "default__get_relation_last_modified", + "macro.dbt.apply_grants": { + "name": "apply_grants", "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 %}", + "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": [] + "macros": [ + "macro.dbt.default__apply_grants" + ] }, "description": "", "meta": {}, @@ -11142,20 +11886,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4343593, + "created_at": 1728697972.602901, "supported_languages": null }, - "macro.dbt.validate_sql": { - "name": "validate_sql", + "macro.dbt.default__apply_grants": { + "name": "default__apply_grants", "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 %}", + "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.default__validate_sql" + "macro.dbt.run_query", + "macro.dbt.get_show_grant_sql", + "macro.dbt.get_dcl_statement_list", + "macro.dbt.call_dcl_statements" ] }, "description": "", @@ -11166,20 +11913,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4345875, + "created_at": 1728697972.6034849, "supported_languages": null }, - "macro.dbt.default__validate_sql": { - "name": "default__validate_sql", + "macro.dbt.get_show_sql": { + "name": "get_show_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 %}", + "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.statement" + "macro.dbt.get_limit_subquery_sql" ] }, "description": "", @@ -11190,20 +11937,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4347458, + "created_at": 1728697972.603714, "supported_languages": null }, - "macro.dbt.make_intermediate_relation": { - "name": "make_intermediate_relation", + "macro.dbt.get_limit_subquery_sql": { + "name": "get_limit_subquery_sql", "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 %}", + "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_postgres.postgres__make_intermediate_relation" + "macro.dbt.default__get_limit_sql" ] }, "description": "", @@ -11214,21 +11961,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4366345, + "created_at": 1728697972.6038148, "supported_languages": null }, - "macro.dbt.default__make_intermediate_relation": { - "name": "default__make_intermediate_relation", + "macro.dbt.default__get_limit_sql": { + "name": "default__get_limit_sql", "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 %}", + "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 {{ compiled_code }}\n {% if limit is not none %}\n limit {{ limit }}\n {%- endif -%}\n{% endmacro %}", "depends_on": { - "macros": [ - "macro.dbt.default__make_temp_relation" - ] + "macros": [] }, "description": "", "meta": {}, @@ -11238,20 +11983,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4367592, + "created_at": 1728697972.603922, "supported_languages": null }, - "macro.dbt.make_temp_relation": { - "name": "make_temp_relation", + "macro.dbt.alter_column_comment": { + "name": "alter_column_comment", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/relation.sql", - "original_file_path": "macros/adapters/relation.sql", - "unique_id": "macro.dbt.make_temp_relation", - "macro_sql": "{% macro make_temp_relation(base_relation, suffix='__dbt_tmp') %}\n {{ return(adapter.dispatch('make_temp_relation', 'dbt')(base_relation, suffix)) }}\n{% endmacro %}", + "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__make_temp_relation" + "macro.dbt_postgres.postgres__alter_column_comment" ] }, "description": "", @@ -11262,17 +12007,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.436917, + "created_at": 1728697972.604347, "supported_languages": null }, - "macro.dbt.default__make_temp_relation": { - "name": "default__make_temp_relation", + "macro.dbt.default__alter_column_comment": { + "name": "default__alter_column_comment", "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 %}", + "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": [] }, @@ -11284,20 +12029,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4371402, + "created_at": 1728697972.6044421, "supported_languages": null }, - "macro.dbt.make_backup_relation": { - "name": "make_backup_relation", + "macro.dbt.alter_relation_comment": { + "name": "alter_relation_comment", "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 %}", + "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__make_backup_relation" + "macro.dbt_postgres.postgres__alter_relation_comment" ] }, "description": "", @@ -11308,17 +12053,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.437321, + "created_at": 1728697972.6045492, "supported_languages": null }, - "macro.dbt.default__make_backup_relation": { - "name": "default__make_backup_relation", + "macro.dbt.default__alter_relation_comment": { + "name": "default__alter_relation_comment", "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 %}", + "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": [] }, @@ -11330,20 +12075,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4375682, + "created_at": 1728697972.604644, "supported_languages": null }, - "macro.dbt.truncate_relation": { - "name": "truncate_relation", + "macro.dbt.persist_docs": { + "name": "persist_docs", "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 %}", + "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__truncate_relation" + "macro.dbt.default__persist_docs" ] }, "description": "", @@ -11354,20 +12099,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4376957, + "created_at": 1728697972.60479, "supported_languages": null }, - "macro.dbt.default__truncate_relation": { - "name": "default__truncate_relation", + "macro.dbt.default__persist_docs": { + "name": "default__persist_docs", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/relation.sql", - "original_file_path": "macros/adapters/relation.sql", - "unique_id": "macro.dbt.default__truncate_relation", - "macro_sql": "{% macro default__truncate_relation(relation) -%}\n {% call statement('truncate_relation') -%}\n truncate table {{ relation }}\n {%- endcall %}\n{% endmacro %}", + "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.statement" + "macro.dbt.run_query", + "macro.dbt.alter_relation_comment", + "macro.dbt.alter_column_comment" ] }, "description": "", @@ -11378,20 +12125,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4378111, + "created_at": 1728697972.60505, "supported_languages": null }, - "macro.dbt.get_or_create_relation": { - "name": "get_or_create_relation", + "macro.dbt.get_catalog_relations": { + "name": "get_catalog_relations", "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 %}", + "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.default__get_or_create_relation" + "macro.dbt_postgres.postgres__get_catalog_relations" ] }, "description": "", @@ -11402,17 +12149,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4379826, + "created_at": 1728697972.607223, "supported_languages": null }, - "macro.dbt.default__get_or_create_relation": { - "name": "default__get_or_create_relation", + "macro.dbt.default__get_catalog_relations": { + "name": "default__get_catalog_relations", "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 %}", + "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": [] }, @@ -11424,19 +12171,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4383667, + "created_at": 1728697972.607369, "supported_languages": null }, - "macro.dbt.load_cached_relation": { - "name": "load_cached_relation", + "macro.dbt.get_catalog": { + "name": "get_catalog", "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 %}", + "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": [] + "macros": [ + "macro.dbt_postgres.postgres__get_catalog" + ] }, "description": "", "meta": {}, @@ -11446,21 +12195,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4385493, + "created_at": 1728697972.607483, "supported_languages": null }, - "macro.dbt.load_relation": { - "name": "load_relation", + "macro.dbt.default__get_catalog": { + "name": "default__get_catalog", "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 %}", + "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": [ - "macro.dbt.load_cached_relation" - ] + "macros": [] }, "description": "", "meta": {}, @@ -11470,20 +12217,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4386542, + "created_at": 1728697972.6076312, "supported_languages": null }, - "macro.dbt.get_create_index_sql": { - "name": "get_create_index_sql", + "macro.dbt.information_schema_name": { + "name": "information_schema_name", "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 %}", + "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__get_create_index_sql" + "macro.dbt_postgres.postgres__information_schema_name" ] }, "description": "", @@ -11494,17 +12241,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4392934, + "created_at": 1728697972.607736, "supported_languages": null }, - "macro.dbt.default__get_create_index_sql": { - "name": "default__get_create_index_sql", + "macro.dbt.default__information_schema_name": { + "name": "default__information_schema_name", "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 %}", + "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": [] }, @@ -11516,20 +12263,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.439387, + "created_at": 1728697972.607827, "supported_languages": null }, - "macro.dbt.create_indexes": { - "name": "create_indexes", + "macro.dbt.list_schemas": { + "name": "list_schemas", "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 %}", + "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.default__create_indexes" + "macro.dbt_postgres.postgres__list_schemas" ] }, "description": "", @@ -11540,20 +12287,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4394984, + "created_at": 1728697972.607929, "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 %}", + "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.get_create_index_sql", + "macro.dbt.information_schema_name", "macro.dbt.run_query" ] }, @@ -11565,20 +12312,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4397836, + "created_at": 1728697972.608066, "supported_languages": null }, - "macro.dbt.get_drop_index_sql": { - "name": "get_drop_index_sql", + "macro.dbt.check_schema_exists": { + "name": "check_schema_exists", "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 %}", + "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__get_drop_index_sql" + "macro.dbt_postgres.postgres__check_schema_exists" ] }, "description": "", @@ -11589,19 +12336,22 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4400208, + "created_at": 1728697972.6081889, "supported_languages": null }, - "macro.dbt.default__get_drop_index_sql": { - "name": "default__get_drop_index_sql", + "macro.dbt.default__check_schema_exists": { + "name": "default__check_schema_exists", "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 %}", + "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": [] + "macros": [ + "macro.dbt.replace", + "macro.dbt.run_query" + ] }, "description": "", "meta": {}, @@ -11611,20 +12361,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4401512, + "created_at": 1728697972.608431, "supported_languages": null }, - "macro.dbt.get_show_indexes_sql": { - "name": "get_show_indexes_sql", + "macro.dbt.list_relations_without_caching": { + "name": "list_relations_without_caching", "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 %}", + "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__get_show_indexes_sql" + "macro.dbt_postgres.postgres__list_relations_without_caching" ] }, "description": "", @@ -11635,17 +12385,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4402647, + "created_at": 1728697972.608534, "supported_languages": null }, - "macro.dbt.default__get_show_indexes_sql": { - "name": "default__get_show_indexes_sql", + "macro.dbt.default__list_relations_without_caching": { + "name": "default__list_relations_without_caching", "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 %}", + "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": [] }, @@ -11657,20 +12407,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4403596, + "created_at": 1728697972.6086242, "supported_languages": null }, - "macro.dbt.collect_freshness": { - "name": "collect_freshness", + "macro.dbt.get_catalog_for_single_relation": { + "name": "get_catalog_for_single_relation", "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 %}", + "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__collect_freshness" + "macro.dbt.default__get_catalog_for_single_relation" ] }, "description": "", @@ -11681,22 +12431,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4408116, + "created_at": 1728697972.608723, "supported_languages": null }, - "macro.dbt.default__collect_freshness": { - "name": "default__collect_freshness", + "macro.dbt.default__get_catalog_for_single_relation": { + "name": "default__get_catalog_for_single_relation", "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 %}", + "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": [ - "macro.dbt.statement", - "macro.dbt.current_timestamp" - ] + "macros": [] }, "description": "", "meta": {}, @@ -11706,20 +12453,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4411116, + "created_at": 1728697972.608813, "supported_languages": null }, - "macro.dbt.copy_grants": { - "name": "copy_grants", + "macro.dbt.get_relations": { + "name": "get_relations", "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 %}", + "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__copy_grants" + "macro.dbt_postgres.postgres__get_relations" ] }, "description": "", @@ -11730,17 +12477,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.442436, + "created_at": 1728697972.608902, "supported_languages": null }, - "macro.dbt.default__copy_grants": { - "name": "default__copy_grants", + "macro.dbt.default__get_relations": { + "name": "default__get_relations", "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 %}", + "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": [] }, @@ -11752,20 +12499,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.442533, + "created_at": 1728697972.6089878, "supported_languages": null }, - "macro.dbt.support_multiple_grantees_per_dcl_statement": { - "name": "support_multiple_grantees_per_dcl_statement", + "macro.dbt.get_relation_last_modified": { + "name": "get_relation_last_modified", "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 %}", + "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__support_multiple_grantees_per_dcl_statement" + "macro.dbt.default__get_relation_last_modified" ] }, "description": "", @@ -11776,17 +12523,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4426484, + "created_at": 1728697972.609102, "supported_languages": null }, - "macro.dbt.default__support_multiple_grantees_per_dcl_statement": { - "name": "default__support_multiple_grantees_per_dcl_statement", + "macro.dbt.default__get_relation_last_modified": { + "name": "default__get_relation_last_modified", "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", + "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": [] }, @@ -11798,20 +12545,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4427257, + "created_at": 1728697972.6092029, "supported_languages": null }, - "macro.dbt.should_revoke": { - "name": "should_revoke", + "macro.dbt.get_columns_in_relation": { + "name": "get_columns_in_relation", "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 %}", + "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.copy_grants" + "macro.dbt_postgres.postgres__get_columns_in_relation" ] }, "description": "", @@ -11822,21 +12569,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4429762, + "created_at": 1728697972.6106482, "supported_languages": null }, - "macro.dbt.get_show_grant_sql": { - "name": "get_show_grant_sql", + "macro.dbt.default__get_columns_in_relation": { + "name": "default__get_columns_in_relation", "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 %}", + "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": [ - "macro.dbt_postgres.postgres__get_show_grant_sql" - ] + "macros": [] }, "description": "", "meta": {}, @@ -11846,17 +12591,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4431021, + "created_at": 1728697972.61074, "supported_languages": null }, - "macro.dbt.default__get_show_grant_sql": { - "name": "default__get_show_grant_sql", + "macro.dbt.sql_convert_columns_in_relation": { + "name": "sql_convert_columns_in_relation", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/apply_grants.sql", - "original_file_path": "macros/adapters/apply_grants.sql", - "unique_id": "macro.dbt.default__get_show_grant_sql", - "macro_sql": "{% macro default__get_show_grant_sql(relation) %}\n show grants on {{ relation }}\n{% endmacro %}", + "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": [] }, @@ -11868,20 +12613,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4431777, + "created_at": 1728697972.61091, "supported_languages": null }, - "macro.dbt.get_grant_sql": { - "name": "get_grant_sql", + "macro.dbt.get_empty_subquery_sql": { + "name": "get_empty_subquery_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 %}", + "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_grant_sql" + "macro.dbt.default__get_empty_subquery_sql" ] }, "description": "", @@ -11892,17 +12637,17 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4433708, + "created_at": 1728697972.611032, "supported_languages": null }, - "macro.dbt.default__get_grant_sql": { - "name": "default__get_grant_sql", + "macro.dbt.default__get_empty_subquery_sql": { + "name": "default__get_empty_subquery_sql", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/apply_grants.sql", - "original_file_path": "macros/adapters/apply_grants.sql", - "unique_id": "macro.dbt.default__get_grant_sql", - "macro_sql": "\n\n{%- macro default__get_grant_sql(relation, privilege, grantees) -%}\n grant {{ privilege }} on {{ relation }} to {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", + "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": [] }, @@ -11914,20 +12659,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.443533, + "created_at": 1728697972.611148, "supported_languages": null }, - "macro.dbt.get_revoke_sql": { - "name": "get_revoke_sql", + "macro.dbt.get_empty_schema_sql": { + "name": "get_empty_schema_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 %}", + "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_revoke_sql" + "macro.dbt.default__get_empty_schema_sql" ] }, "description": "", @@ -11938,42 +12683,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.443699, - "supported_languages": null - }, - "macro.dbt.default__get_revoke_sql": { - "name": "default__get_revoke_sql", - "resource_type": "macro", - "package_name": "dbt", - "path": "macros/adapters/apply_grants.sql", - "original_file_path": "macros/adapters/apply_grants.sql", - "unique_id": "macro.dbt.default__get_revoke_sql", - "macro_sql": "\n\n{%- macro default__get_revoke_sql(relation, privilege, grantees) -%}\n revoke {{ privilege }} on {{ relation }} from {{ grantees | join(', ') }}\n{%- endmacro -%}\n\n\n", - "depends_on": { - "macros": [] - }, - "description": "", - "meta": {}, - "docs": { - "show": true, - "node_color": null - }, - "patch_path": null, - "arguments": [], - "created_at": 1718342580.443834, + "created_at": 1728697972.61125, "supported_languages": null }, - "macro.dbt.get_dcl_statement_list": { - "name": "get_dcl_statement_list", + "macro.dbt.default__get_empty_schema_sql": { + "name": "default__get_empty_schema_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_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 %}", + "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.default__get_dcl_statement_list" + "macro.dbt.cast" ] }, "description": "", @@ -11984,20 +12707,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4439936, + "created_at": 1728697972.6118898, "supported_languages": null - }, - "macro.dbt.default__get_dcl_statement_list": { - "name": "default__get_dcl_statement_list", + }, + "macro.dbt.get_column_schema_from_query": { + "name": "get_column_schema_from_query", "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 %}", + "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.support_multiple_grantees_per_dcl_statement" + "macro.dbt.get_empty_subquery_sql" ] }, "description": "", @@ -12008,20 +12731,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4444935, + "created_at": 1728697972.612082, "supported_languages": null }, - "macro.dbt.call_dcl_statements": { - "name": "call_dcl_statements", + "macro.dbt.get_columns_in_query": { + "name": "get_columns_in_query", "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 %}", + "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__call_dcl_statements" + "macro.dbt.default__get_columns_in_query" ] }, "description": "", @@ -12032,20 +12755,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4446437, + "created_at": 1728697972.612185, "supported_languages": null }, - "macro.dbt.default__call_dcl_statements": { - "name": "default__call_dcl_statements", + "macro.dbt.default__get_columns_in_query": { + "name": "default__get_columns_in_query", "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 %}", + "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.statement", + "macro.dbt.get_empty_subquery_sql" ] }, "description": "", @@ -12056,20 +12780,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4448314, + "created_at": 1728697972.612374, "supported_languages": null }, - "macro.dbt.apply_grants": { - "name": "apply_grants", + "macro.dbt.alter_column_type": { + "name": "alter_column_type", "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 %}", + "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__apply_grants" + "macro.dbt.default__alter_column_type" ] }, "description": "", @@ -12080,23 +12804,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4451659, + "created_at": 1728697972.612504, "supported_languages": null }, - "macro.dbt.default__apply_grants": { - "name": "default__apply_grants", + "macro.dbt.default__alter_column_type": { + "name": "default__alter_column_type", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/apply_grants.sql", - "original_file_path": "macros/adapters/apply_grants.sql", - "unique_id": "macro.dbt.default__apply_grants", - "macro_sql": "{% macro default__apply_grants(relation, grant_config, should_revoke=True) %}\n {#-- If grant_config is {} or None, this is a no-op --#}\n {% if grant_config %}\n {% if should_revoke %}\n {#-- We think previous grants may have carried over --#}\n {#-- Show current grants and calculate diffs --#}\n {% set current_grants_table = run_query(get_show_grant_sql(relation)) %}\n {% set current_grants_dict = adapter.standardize_grants_dict(current_grants_table) %}\n {% set needs_granting = diff_of_two_dicts(grant_config, current_grants_dict) %}\n {% set needs_revoking = diff_of_two_dicts(current_grants_dict, grant_config) %}\n {% if not (needs_granting or needs_revoking) %}\n {{ log('On ' ~ relation ~': All grants are in place, no revocation or granting needed.')}}\n {% endif %}\n {% else %}\n {#-- We don't think there's any chance of previous grants having carried over. --#}\n {#-- Jump straight to granting what the user has configured. --#}\n {% set needs_revoking = {} %}\n {% set needs_granting = grant_config %}\n {% endif %}\n {% if needs_granting or needs_revoking %}\n {% set revoke_statement_list = get_dcl_statement_list(relation, needs_revoking, get_revoke_sql) %}\n {% set grant_statement_list = get_dcl_statement_list(relation, needs_granting, get_grant_sql) %}\n {% set dcl_statement_list = revoke_statement_list + grant_statement_list %}\n {% if dcl_statement_list %}\n {{ call_dcl_statements(dcl_statement_list) }}\n {% endif %}\n {% endif %}\n {% endif %}\n{% endmacro %}", + "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.run_query", - "macro.dbt.get_show_grant_sql", - "macro.dbt.get_dcl_statement_list", - "macro.dbt.call_dcl_statements" + "macro.dbt.statement" ] }, "description": "", @@ -12107,20 +12828,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.446021, + "created_at": 1728697972.612871, "supported_languages": null }, - "macro.dbt.get_columns_in_relation": { - "name": "get_columns_in_relation", + "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.get_columns_in_relation", - "macro_sql": "{% macro get_columns_in_relation(relation) -%}\n {{ return(adapter.dispatch('get_columns_in_relation', 'dbt')(relation)) }}\n{% endmacro %}", + "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_postgres.postgres__get_columns_in_relation" + "macro.dbt.default__alter_relation_add_remove_columns" ] }, "description": "", @@ -12131,19 +12852,21 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.447782, + "created_at": 1728697972.613015, "supported_languages": null }, - "macro.dbt.default__get_columns_in_relation": { - "name": "default__get_columns_in_relation", + "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__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 %}", + "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.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.run_query" + ] }, "description": "", "meta": {}, @@ -12153,19 +12876,24 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4478931, + "created_at": 1728697972.613463, "supported_languages": null }, - "macro.dbt.sql_convert_columns_in_relation": { - "name": "sql_convert_columns_in_relation", + "macro.dbt.get_fixture_sql": { + "name": "get_fixture_sql", "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 %}", + "path": "macros/unit_test_sql/get_fixture_sql.sql", + "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", + "unique_id": "macro.dbt.get_fixture_sql", + "macro_sql": "{% macro get_fixture_sql(rows, column_name_to_data_types) %}\n-- Fixture for {{ model.name }}\n{% set default_row = {} %}\n\n{%- if not column_name_to_data_types -%}\n{#-- Use defer_relation IFF it is available in the manifest and 'this' is missing from the database --#}\n{%- set this_or_defer_relation = defer_relation if (defer_relation and not load_relation(this)) else this -%}\n{%- set columns_in_relation = adapter.get_columns_in_relation(this_or_defer_relation) -%}\n\n{%- set column_name_to_data_types = {} -%}\n{%- for column in columns_in_relation -%}\n{#-- This needs to be a case-insensitive comparison --#}\n{%- do column_name_to_data_types.update({column.name|lower: column.data_type}) -%}\n{%- endfor -%}\n{%- endif -%}\n\n{%- if not column_name_to_data_types -%}\n {{ exceptions.raise_compiler_error(\"Not able to get columns for unit test '\" ~ model.name ~ \"' from relation \" ~ this ~ \" because the relation doesn't exist\") }}\n{%- endif -%}\n\n{%- for column_name, column_type in column_name_to_data_types.items() -%}\n {%- do default_row.update({column_name: (safe_cast(\"null\", column_type) | trim )}) -%}\n{%- endfor -%}\n\n{{ 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 }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n\n{%- if (rows | length) == 0 -%}\n select\n {%- for column_name, column_value in default_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%},{%- endif %}\n {%- endfor %}\n limit 0\n{%- endif -%}\n{% endmacro %}", "depends_on": { - "macros": [] + "macros": [ + "macro.dbt.load_relation", + "macro.dbt.safe_cast", + "macro.dbt.validate_fixture_rows", + "macro.dbt.format_row" + ] }, "description": "", "meta": {}, @@ -12175,20 +12903,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4481127, + "created_at": 1728697972.6156511, "supported_languages": null }, - "macro.dbt.get_empty_subquery_sql": { - "name": "get_empty_subquery_sql", + "macro.dbt.get_expected_sql": { + "name": "get_expected_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 %}", + "path": "macros/unit_test_sql/get_fixture_sql.sql", + "original_file_path": "macros/unit_test_sql/get_fixture_sql.sql", + "unique_id": "macro.dbt.get_expected_sql", + "macro_sql": "{% macro get_expected_sql(rows, column_name_to_data_types) %}\n\n{%- if (rows | length) == 0 -%}\n select * from dbt_internal_unit_test_actual\n limit 0\n{%- else -%}\n{%- for row in rows -%}\n{%- set formatted_row = format_row(row, column_name_to_data_types) -%}\nselect\n{%- for column_name, column_value in formatted_row.items() %} {{ column_value }} as {{ column_name }}{% if not loop.last -%}, {%- endif %}\n{%- endfor %}\n{%- if not loop.last %}\nunion all\n{% endif %}\n{%- endfor -%}\n{%- endif -%}\n\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.default__get_empty_subquery_sql" + "macro.dbt.format_row" ] }, "description": "", @@ -12199,19 +12927,23 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4482665, + "created_at": 1728697972.615957, "supported_languages": null }, - "macro.dbt.default__get_empty_subquery_sql": { - "name": "default__get_empty_subquery_sql", + "macro.dbt.format_row": { + "name": "format_row", "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 %}", + "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": [] + "macros": [ + "macro.dbt.string_literal", + "macro.dbt.escape_single_quotes", + "macro.dbt.safe_cast" + ] }, "description": "", "meta": {}, @@ -12221,20 +12953,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4484205, + "created_at": 1728697972.6165981, "supported_languages": null }, - "macro.dbt.get_empty_schema_sql": { - "name": "get_empty_schema_sql", + "macro.dbt.validate_fixture_rows": { + "name": "validate_fixture_rows", "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 %}", + "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__get_empty_schema_sql" + "macro.dbt.default__validate_fixture_rows" ] }, "description": "", @@ -12245,21 +12977,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4485488, + "created_at": 1728697972.616714, "supported_languages": null }, - "macro.dbt.default__get_empty_schema_sql": { - "name": "default__get_empty_schema_sql", + "macro.dbt.default__validate_fixture_rows": { + "name": "default__validate_fixture_rows", "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 %}", + "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": [ - "macro.dbt.cast" - ] + "macros": [] }, "description": "", "meta": {}, @@ -12269,20 +12999,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4496489, + "created_at": 1728697972.616768, "supported_languages": null }, - "macro.dbt.get_column_schema_from_query": { - "name": "get_column_schema_from_query", + "macro.dbt.resolve_model_name": { + "name": "resolve_model_name", "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 %}", + "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.get_empty_subquery_sql" + "macro.dbt.default__resolve_model_name" ] }, "description": "", @@ -12293,21 +13023,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4498816, + "created_at": 1728697972.617768, "supported_languages": null }, - "macro.dbt.get_columns_in_query": { - "name": "get_columns_in_query", + "macro.dbt.default__resolve_model_name": { + "name": "default__resolve_model_name", "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 %}", + "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": [ - "macro.dbt.default__get_columns_in_query" - ] + "macros": [] }, "description": "", "meta": {}, @@ -12317,21 +13045,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.450087, + "created_at": 1728697972.617853, "supported_languages": null }, - "macro.dbt.default__get_columns_in_query": { - "name": "default__get_columns_in_query", + "macro.dbt.build_ref_function": { + "name": "build_ref_function", "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 %}", + "path": "macros/python_model/python.sql", + "original_file_path": "macros/python_model/python.sql", + "unique_id": "macro.dbt.build_ref_function", + "macro_sql": "{% macro build_ref_function(model) %}\n\n {%- set ref_dict = {} -%}\n {%- for _ref in model.refs -%}\n {% set _ref_args = [_ref.get('package'), _ref['name']] if _ref.get('package') else [_ref['name'],] %}\n {%- set resolved = ref(*_ref_args, v=_ref.get('version')) -%}\n {%- if _ref.get('version') -%}\n {% do _ref_args.extend([\"v\" ~ _ref['version']]) %}\n {%- endif -%}\n {%- do ref_dict.update({_ref_args | join('.'): resolve_model_name(resolved)}) -%}\n {%- endfor -%}\n\ndef ref(*args, **kwargs):\n refs = {{ ref_dict | tojson }}\n key = '.'.join(args)\n version = kwargs.get(\"v\") or kwargs.get(\"version\")\n if version:\n key += f\".v{version}\"\n dbt_load_df_function = kwargs.get(\"dbt_load_df_function\")\n return dbt_load_df_function(refs[key])\n\n{% endmacro %}", "depends_on": { "macros": [ - "macro.dbt.statement", - "macro.dbt.get_empty_subquery_sql" + "macro.dbt.resolve_model_name" ] }, "description": "", @@ -12342,20 +13069,20 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4503593, + "created_at": 1728697972.618272, "supported_languages": null }, - "macro.dbt.alter_column_type": { - "name": "alter_column_type", + "macro.dbt.build_source_function": { + "name": "build_source_function", "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 %}", + "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.default__alter_column_type" + "macro.dbt.resolve_model_name" ] }, "description": "", @@ -12366,21 +13093,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.450553, + "created_at": 1728697972.618489, "supported_languages": null }, - "macro.dbt.default__alter_column_type": { - "name": "default__alter_column_type", + "macro.dbt.build_config_dict": { + "name": "build_config_dict", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/columns.sql", - "original_file_path": "macros/adapters/columns.sql", - "unique_id": "macro.dbt.default__alter_column_type", - "macro_sql": "{% macro default__alter_column_type(relation, column_name, new_column_type) -%}\n {#\n 1. Create a new column (w/ temp name and correct type)\n 2. Copy data over to it\n 3. Drop the existing column (cascade!)\n 4. Rename the new column to existing column\n #}\n {%- set tmp_column = column_name + \"__dbt_alter\" -%}\n\n {% call statement('alter_column_type') %}\n alter table {{ relation }} add column {{ adapter.quote(tmp_column) }} {{ new_column_type }};\n update {{ relation }} set {{ adapter.quote(tmp_column) }} = {{ adapter.quote(column_name) }};\n alter table {{ relation }} drop column {{ adapter.quote(column_name) }} cascade;\n alter table {{ relation }} rename column {{ adapter.quote(tmp_column) }} to {{ adapter.quote(column_name) }}\n {% endcall %}\n\n{% endmacro %}", + "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": [ - "macro.dbt.statement" - ] + "macros": [] }, "description": "", "meta": {}, @@ -12390,20 +13115,25 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4509845, + "created_at": 1728697972.618793, "supported_languages": null }, - "macro.dbt.alter_relation_add_remove_columns": { - "name": "alter_relation_add_remove_columns", + "macro.dbt.py_script_postfix": { + "name": "py_script_postfix", "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 %}", + "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.default__alter_relation_add_remove_columns" + "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": "", @@ -12414,21 +13144,19 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4511735, + "created_at": 1728697972.6190479, "supported_languages": null }, - "macro.dbt.default__alter_relation_add_remove_columns": { - "name": "default__alter_relation_add_remove_columns", + "macro.dbt.py_script_comment": { + "name": "py_script_comment", "resource_type": "macro", "package_name": "dbt", - "path": "macros/adapters/columns.sql", - "original_file_path": "macros/adapters/columns.sql", - "unique_id": "macro.dbt.default__alter_relation_add_remove_columns", - "macro_sql": "{% macro default__alter_relation_add_remove_columns(relation, add_columns, remove_columns) %}\n\n {% if add_columns is none %}\n {% set add_columns = [] %}\n {% endif %}\n {% if remove_columns is none %}\n {% set remove_columns = [] %}\n {% endif %}\n\n {% set sql -%}\n\n alter {{ relation.type }} {{ relation }}\n\n {% for column in add_columns %}\n add column {{ column.name }} {{ column.data_type }}{{ ',' if not loop.last }}\n {% endfor %}{{ ',' if add_columns and remove_columns }}\n\n {% for column in remove_columns %}\n drop column {{ column.name }}{{ ',' if not loop.last }}\n {% endfor %}\n\n {%- endset -%}\n\n {% do run_query(sql) %}\n\n{% endmacro %}", + "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": [ - "macro.dbt.run_query" - ] + "macros": [] }, "description": "", "meta": {}, @@ -12438,7 +13166,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4517665, + "created_at": 1728697972.619092, "supported_languages": null }, "macro.dbt.test_unique": { @@ -12462,7 +13190,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4521935, + "created_at": 1728697972.619404, "supported_languages": null }, "macro.dbt.test_not_null": { @@ -12486,7 +13214,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.452389, + "created_at": 1728697972.61954, "supported_languages": null }, "macro.dbt.test_accepted_values": { @@ -12510,7 +13238,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4527092, + "created_at": 1728697972.619704, "supported_languages": null }, "macro.dbt.test_relationships": { @@ -12534,7 +13262,7 @@ }, "patch_path": null, "arguments": [], - "created_at": 1718342580.4529166, + "created_at": 1728697972.619862, "supported_languages": null } }, @@ -12549,12 +13277,404 @@ "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" } }, - "exposures": {}, + "exposures": { + "exposure.sandbox.completed_orders_cte_sql": { + "name": "completed_orders_cte_sql", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.completed_orders_cte_sql", + "fqn": [ + "sandbox", + "exposures", + "completed_orders_cte_sql" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nCTE SQL\n\n#### Query\n\n```\nwith completed_orders as (\n select * from Orders where status = 'completed'\n)\nselect * from completed_orders\n```\n\n#### Metadata\n\nMetabase ID: __32__\n\nCreated On: __2024-06-20T06:01:34.470497Z__", + "label": "Completed Orders CTE SQL", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/32", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.orders" + ] + }, + "refs": [ + { + "name": "orders", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.910919 + }, + "exposure.sandbox.dummy": { + "name": "dummy", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.dummy", + "fqn": [ + "sandbox", + "exposures", + "dummy" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nDummy 1\n\n#### Query\n\n```\nselect 1;\n```\n\n#### Metadata\n\nMetabase ID: __30__\n\nCreated On: __2024-06-20T05:56:33.051625Z__", + "label": "Dummy", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/30", + "depends_on": { + "macros": [], + "nodes": [] + }, + "refs": [], + "sources": [], + "metrics": [], + "created_at": 1728697972.911566 + }, + "exposure.sandbox.dummy_1": { + "name": "dummy_1", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.dummy_1", + "fqn": [ + "sandbox", + "exposures", + "dummy_1" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nDummy 2\n\n#### Query\n\n```\nselect 2;\n```\n\n#### Metadata\n\nMetabase ID: __31__\n\nCreated On: __2024-06-20T05:56:45.033599Z__", + "label": "Dummy", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/31", + "depends_on": { + "macros": [], + "nodes": [] + }, + "refs": [], + "sources": [], + "metrics": [], + "created_at": 1728697972.9118578 + }, + "exposure.sandbox.orders___customers": { + "name": "orders___customers", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.orders___customers", + "fqn": [ + "sandbox", + "exposures", + "orders___customers" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nOrders and customers\n\n#### Metadata\n\nMetabase ID: __27__\n\nCreated On: __2024-06-19T11:57:35.85999Z__", + "label": "Orders + Customers", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/27", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.customers", + "model.sandbox.orders" + ] + }, + "refs": [ + { + "name": "customers", + "package": null, + "version": null + }, + { + "name": "orders", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.912312 + }, + "exposure.sandbox.orders___customers__filtered_by_status_is_completed": { + "name": "orders___customers__filtered_by_status_is_completed", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.orders___customers__filtered_by_status_is_completed", + "fqn": [ + "sandbox", + "exposures", + "orders___customers__filtered_by_status_is_completed" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nNo description provided in Metabase\n\n#### Metadata\n\nMetabase ID: __28__\n\nCreated On: __2024-06-19T11:58:35.060527Z__", + "label": "Orders + Customers, Filtered by Status is completed", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/28", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.customers", + "model.sandbox.orders" + ] + }, + "refs": [ + { + "name": "customers", + "package": null, + "version": null + }, + { + "name": "orders", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.912936 + }, + "exposure.sandbox.returned_order_count_sql": { + "name": "returned_order_count_sql", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.returned_order_count_sql", + "fqn": [ + "sandbox", + "exposures", + "returned_order_count_sql" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Scalar\n\nNo description provided in Metabase\n\n#### Query\n\n```\nselect\n count(*)\nfrom STG_payments as p\n left join STG_orders as o on p.order_id = o.order_id\nwhere o.status = 'returned'\n;\n```\n\n#### Metadata\n\nMetabase ID: __29__\n\nCreated On: __2024-06-19T12:03:01.905927Z__", + "label": "Returned Order Count SQL", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/29", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.stg_orders", + "model.sandbox.stg_payments" + ] + }, + "refs": [ + { + "name": "stg_orders", + "package": null, + "version": null + }, + { + "name": "stg_payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.914315 + }, + "exposure.sandbox.the_dashboard": { + "name": "the_dashboard", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.the_dashboard", + "fqn": [ + "sandbox", + "exposures", + "the_dashboard" + ], + "type": "dashboard", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Dashboard Cards: 3\n\nDashboard is a dashboard is a dashboard\n\n#### Metadata\n\nMetabase ID: __2__\n\nCreated On: __2024-06-19T11:57:43.675681Z__", + "label": "The Dashboard", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/dashboard/2", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.customers", + "model.sandbox.orders", + "model.sandbox.stg_orders", + "model.sandbox.stg_payments" + ] + }, + "refs": [ + { + "name": "customers", + "package": null, + "version": null + }, + { + "name": "orders", + "package": null, + "version": null + }, + { + "name": "stg_orders", + "package": null, + "version": null + }, + { + "name": "stg_payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.9152288 + }, + "exposure.sandbox.transactions": { + "name": "transactions", + "resource_type": "exposure", + "package_name": "sandbox", + "path": "exposures/our_analytics.yml", + "original_file_path": "models/exposures/our_analytics.yml", + "unique_id": "exposure.sandbox.transactions", + "fqn": [ + "sandbox", + "exposures", + "transactions" + ], + "type": "analysis", + "owner": { + "email": "dbtmetabase@example.com", + "name": "dbtmetabase" + }, + "description": "### Visualization: Table\n\nNo description provided in Metabase\n\n#### Metadata\n\nMetabase ID: __33__\n\nCreated On: __2024-10-11T23:46:29.272117Z__", + "label": "Transactions", + "maturity": "medium", + "meta": {}, + "tags": [ + "metabase" + ], + "config": { + "enabled": true + }, + "unrendered_config": {}, + "url": "http://localhost:3000/card/33", + "depends_on": { + "macros": [], + "nodes": [ + "model.sandbox.payments" + ] + }, + "refs": [ + { + "name": "payments", + "package": null, + "version": null + } + ], + "sources": [], + "metrics": [], + "created_at": 1728697972.916076 + } + }, "metrics": {}, "groups": {}, "selectors": {}, "disabled": {}, "parent_map": { + "model.sandbox.payments": [ + "model.sandbox.stg_payments" + ], "model.sandbox.customers": [ "model.sandbox.stg_customers", "model.sandbox.stg_orders", @@ -12609,6 +13729,18 @@ "test.sandbox.not_null_orders_gift_card_amount.413a0d2d7a": [ "model.sandbox.orders" ], + "test.sandbox.unique_payments_payment_id.a01e74ab12": [ + "model.sandbox.payments" + ], + "test.sandbox.not_null_payments_payment_id.581e6708cd": [ + "model.sandbox.payments" + ], + "test.sandbox.accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.7da71fe81b": [ + "model.sandbox.payments" + ], + "test.sandbox.not_null_payments_order_id.24258dbcca": [ + "model.sandbox.payments" + ], "test.sandbox.unique_stg_customers_customer_id.c7614daada": [ "model.sandbox.stg_customers" ], @@ -12632,14 +13764,54 @@ ], "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [ "model.sandbox.stg_payments" + ], + "exposure.sandbox.completed_orders_cte_sql": [ + "model.sandbox.orders" + ], + "exposure.sandbox.dummy": [], + "exposure.sandbox.dummy_1": [], + "exposure.sandbox.orders___customers": [ + "model.sandbox.customers", + "model.sandbox.orders" + ], + "exposure.sandbox.orders___customers__filtered_by_status_is_completed": [ + "model.sandbox.customers", + "model.sandbox.orders" + ], + "exposure.sandbox.returned_order_count_sql": [ + "model.sandbox.stg_orders", + "model.sandbox.stg_payments" + ], + "exposure.sandbox.the_dashboard": [ + "model.sandbox.customers", + "model.sandbox.orders", + "model.sandbox.stg_orders", + "model.sandbox.stg_payments" + ], + "exposure.sandbox.transactions": [ + "model.sandbox.payments" ] }, "child_map": { + "model.sandbox.payments": [ + "exposure.sandbox.transactions", + "test.sandbox.accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.7da71fe81b", + "test.sandbox.not_null_payments_order_id.24258dbcca", + "test.sandbox.not_null_payments_payment_id.581e6708cd", + "test.sandbox.unique_payments_payment_id.a01e74ab12" + ], "model.sandbox.customers": [ + "exposure.sandbox.orders___customers", + "exposure.sandbox.orders___customers__filtered_by_status_is_completed", + "exposure.sandbox.the_dashboard", "test.sandbox.not_null_customers_customer_id.5c9bf9911d", "test.sandbox.unique_customers_customer_id.c5af1ff4b1" ], "model.sandbox.orders": [ + "exposure.sandbox.completed_orders_cte_sql", + "exposure.sandbox.orders___customers", + "exposure.sandbox.orders___customers__filtered_by_status_is_completed", + "exposure.sandbox.the_dashboard", "test.sandbox.accepted_values_orders_status__placed__shipped__completed__return_pending__returned.be6b5b5ec3", "test.sandbox.not_null_orders_amount.106140f9fd", "test.sandbox.not_null_orders_bank_transfer_amount.7743500c49", @@ -12656,13 +13828,18 @@ "test.sandbox.unique_stg_customers_customer_id.c7614daada" ], "model.sandbox.stg_payments": [ + "exposure.sandbox.returned_order_count_sql", + "exposure.sandbox.the_dashboard", "model.sandbox.customers", "model.sandbox.orders", + "model.sandbox.payments", "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278", "test.sandbox.not_null_stg_payments_payment_id.c19cc50075", "test.sandbox.unique_stg_payments_payment_id.3744510712" ], "model.sandbox.stg_orders": [ + "exposure.sandbox.returned_order_count_sql", + "exposure.sandbox.the_dashboard", "model.sandbox.customers", "model.sandbox.orders", "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad", @@ -12689,6 +13866,10 @@ "test.sandbox.not_null_orders_coupon_amount.ab90c90625": [], "test.sandbox.not_null_orders_bank_transfer_amount.7743500c49": [], "test.sandbox.not_null_orders_gift_card_amount.413a0d2d7a": [], + "test.sandbox.unique_payments_payment_id.a01e74ab12": [], + "test.sandbox.not_null_payments_payment_id.581e6708cd": [], + "test.sandbox.accepted_values_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.7da71fe81b": [], + "test.sandbox.not_null_payments_order_id.24258dbcca": [], "test.sandbox.unique_stg_customers_customer_id.c7614daada": [], "test.sandbox.not_null_stg_customers_customer_id.e2cfb1f9aa": [], "test.sandbox.unique_stg_orders_order_id.e3b841c71a": [], @@ -12696,7 +13877,15 @@ "test.sandbox.accepted_values_stg_orders_status__placed__shipped__completed__return_pending__returned.080fb20aad": [], "test.sandbox.unique_stg_payments_payment_id.3744510712": [], "test.sandbox.not_null_stg_payments_payment_id.c19cc50075": [], - "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [] + "test.sandbox.accepted_values_stg_payments_payment_method__credit_card__coupon__bank_transfer__gift_card.3c3820f278": [], + "exposure.sandbox.completed_orders_cte_sql": [], + "exposure.sandbox.dummy": [], + "exposure.sandbox.dummy_1": [], + "exposure.sandbox.orders___customers": [], + "exposure.sandbox.orders___customers__filtered_by_status_is_completed": [], + "exposure.sandbox.returned_order_count_sql": [], + "exposure.sandbox.the_dashboard": [], + "exposure.sandbox.transactions": [] }, "group_map": {}, "saved_queries": {}, diff --git a/tests/test_exposures.py b/tests/test_exposures.py index d365408b..51281edb 100644 --- a/tests/test_exposures.py +++ b/tests/test_exposures.py @@ -40,29 +40,6 @@ def test_exposures_default(core: MockDbtMetabase): ) -def test_exposures_default_aliased(core: MockDbtMetabase): - for model in core.manifest.read_models(): - if not model.name.startswith("stg_"): - model.alias = f"{model.name}_alias" - - aliases = [m.alias for m in core.manifest.read_models()] - assert "orders_alias" in aliases - assert "customers_alias" in aliases - - fixtures_path = FIXTURES_PATH / "exposure" / "default" - output_path = TMP_PATH / "exposure" / "aliased" - core.extract_exposures( - output_path=str(output_path), - output_grouping=None, - tags=["metabase"], - ) - - _assert_exposures( - fixtures_path / "exposures.yml", - output_path / "exposures.yml", - ) - - def test_exposures_collection_grouping(core: MockDbtMetabase): fixtures_path = FIXTURES_PATH / "exposure" / "collection" output_path = TMP_PATH / "exposure" / "collection" diff --git a/tests/test_manifest.py b/tests/test_manifest.py index 4a8e0986..d9dc1428 100644 --- a/tests/test_manifest.py +++ b/tests/test_manifest.py @@ -23,6 +23,37 @@ def test_v12(): _assert_models_equal( models, [ + Model( + database="dbtmetabase", + schema="public", + group=Group.nodes, + name="payments", + alias="transactions", + description="This table has basic information about payments", + unique_id="model.sandbox.payments", + columns=[ + Column( + name="payment_id", + description="This is a unique identifier for a payment", + semantic_type="type/PK", + ), + Column( + name="payment_method", + description="", + ), + Column( + name="order_id", + description="Foreign key to the orders table", + semantic_type="type/FK", + fk_target_table="public.orders", + fk_target_field="order_id", + ), + Column( + name="amount", + description="", + ), + ], + ), Model( database="dbtmetabase", schema="public", @@ -125,6 +156,7 @@ def test_v12(): alias="stg_customers", description="", unique_id="model.sandbox.stg_customers", + visibility_type="hidden", columns=[ Column( name="customer_id", diff --git a/tests/test_models.py b/tests/test_models.py index 9fee2564..db0a8775 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -43,7 +43,7 @@ def test_export_hidden_table(core: MockDbtMetabase): def test_build_lookups(core: MockDbtMetabase): expected = { - "PUBLIC.CUSTOMERS": [ + "PUBLIC.CUSTOMERS": { "CUSTOMER_ID", "FIRST_NAME", "LAST_NAME", @@ -51,8 +51,8 @@ def test_build_lookups(core: MockDbtMetabase): "MOST_RECENT_ORDER", "NUMBER_OF_ORDERS", "CUSTOMER_LIFETIME_VALUE", - ], - "PUBLIC.ORDERS": [ + }, + "PUBLIC.ORDERS": { "ORDER_ID", "CUSTOMER_ID", "ORDER_DATE", @@ -62,23 +62,32 @@ def test_build_lookups(core: MockDbtMetabase): "COUPON_AMOUNT", "BANK_TRANSFER_AMOUNT", "GIFT_CARD_AMOUNT", - ], - "PUBLIC.RAW_CUSTOMERS": ["ID", "FIRST_NAME", "LAST_NAME"], - "PUBLIC.RAW_ORDERS": ["ID", "USER_ID", "ORDER_DATE", "STATUS"], - "PUBLIC.RAW_PAYMENTS": ["ID", "ORDER_ID", "PAYMENT_METHOD", "AMOUNT"], - "PUBLIC.STG_CUSTOMERS": ["CUSTOMER_ID", "FIRST_NAME", "LAST_NAME"], - "PUBLIC.STG_ORDERS": ["ORDER_ID", "STATUS", "ORDER_DATE", "CUSTOMER_ID"], - "PUBLIC.STG_PAYMENTS": [ + }, + "PUBLIC.PAYMENTS": { + "PAYMENT_ID", # TODO: why? + }, + "PUBLIC.TRANSACTIONS": { "PAYMENT_ID", "PAYMENT_METHOD", "ORDER_ID", "AMOUNT", - ], + }, + "PUBLIC.RAW_CUSTOMERS": {"ID", "FIRST_NAME", "LAST_NAME"}, + "PUBLIC.RAW_ORDERS": {"ID", "USER_ID", "ORDER_DATE", "STATUS"}, + "PUBLIC.RAW_PAYMENTS": {"ID", "ORDER_ID", "PAYMENT_METHOD", "AMOUNT"}, + "PUBLIC.STG_CUSTOMERS": {"CUSTOMER_ID", "FIRST_NAME", "LAST_NAME"}, + "PUBLIC.STG_ORDERS": {"ORDER_ID", "STATUS", "ORDER_DATE", "CUSTOMER_ID"}, + "PUBLIC.STG_PAYMENTS": { + "PAYMENT_ID", + "PAYMENT_METHOD", + "ORDER_ID", + "AMOUNT", + }, } actual_tables = core._ModelsMixin__get_tables(database_id="2") # type: ignore - assert list(actual_tables.keys()) == list(expected.keys()) + assert set(actual_tables.keys()) == set(expected.keys()) for table, columns in expected.items(): - assert list(actual_tables[table]["fields"].keys()) == columns + assert set(actual_tables[table]["fields"].keys()) == columns, f"table: {table}"