Skip to content

Commit

Permalink
Moving to new folder structure and starting updating the config params
Browse files Browse the repository at this point in the history
  • Loading branch information
Vikas Grover authored and Vikas Grover committed Feb 8, 2024
1 parent 97103a6 commit 914181e
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 312 deletions.
36 changes: 0 additions & 36 deletions pmt/dbt/models/dpl/dim_business_area.sql

This file was deleted.

19 changes: 0 additions & 19 deletions pmt/dbt/models/dpl/dim_location.sql

This file was deleted.

39 changes: 0 additions & 39 deletions pmt/dbt/models/dpl/dim_ministry.sql

This file was deleted.

20 changes: 0 additions & 20 deletions pmt/dbt/models/dpl/dim_org.sql

This file was deleted.

15 changes: 0 additions & 15 deletions pmt/dbt/models/dpl/dim_permit_status.sql

This file was deleted.

33 changes: 0 additions & 33 deletions pmt/dbt/models/dpl/dim_permit_type.sql

This file was deleted.

21 changes: 0 additions & 21 deletions pmt/dbt/models/dpl/dim_project.sql

This file was deleted.

17 changes: 0 additions & 17 deletions pmt/dbt/models/dpl/dim_source_system.sql

This file was deleted.

78 changes: 0 additions & 78 deletions pmt/dbt/models/dpl/fact_permits.sql

This file was deleted.

65 changes: 31 additions & 34 deletions pmt/dbt/pmt_dbt/snapshots/dpl/dim_org.sql
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
{% snapshot dim_org %}

{{
config(
target_schema='pmt_dpl',
strategy='check',
unique_key='pi_hash_key',
check_cols='all',
bind=False,
)
}}

WITH scd_data AS (
SELECT
'CORP' as src_sys_code
,org.org_unit_code as org_unit_code
,org.org_unit_name as org_unit_description
,org.rollup_region_code as rollup_region_code
,null as rollup_region_description
,org.rollup_dist_code as rollup_district_code
,null as rollup_district_description
,null as roll_up_area_code
,null as roll_up_area_description,
-- Combine multiple keys into a single composite_key
md5(coalesce(cast('COPR' as varchar),'~') || '|'||
coalesce(cast(org_unit_code as varchar),'~')) as pi_hash_key
FROM fdw_ods_fta_replication.org_unit org
)

SELECT *
FROM scd_data


{% endsnapshot %}
{% snapshot dim_org %}

{{
config(
target_schema='pmt_dpl',
strategy='check',
unique_key='pi_hash_key',
check_cols='all',
invalidate_hard_deletes=True,
bind=False,
)
}}

with corp_data as (
select 'CORP' as src_sys_code
,org.org_unit_code as org_unit_code
,org.org_unit_name as org_unit_description
,org.rollup_region_code as rollup_region_code
,null as rollup_region_description
,org.rollup_dist_code as rollup_district_code
,null as rollup_district_description
,null as roll_up_area_code
,null as roll_up_area_description
from fdw_ods_fta_replication.org_unit org
)
--insert into pmt_dpl.dim_org
select *
from corp_data
;

{% endsnapshot %}

0 comments on commit 914181e

Please sign in to comment.