align hierarchy outputs with DWS naming

This commit is contained in:
2026-08-20 19:01:46 +08:00
parent faddf38c9b
commit 33e60d02e3
6 changed files with 380 additions and 487 deletions
@@ -2,14 +2,15 @@
-- =============================================================================
-- Purpose : Build the flattened IMS ATC level 1-4 hierarchy.
-- Source : dwd.dwd_ims_td_therapeutic_class
-- Target : dwd.dwd_ims_atc_hierarchy
-- Target : dws.dws_ext_td_ims_atc_hierarchy
-- Grain : One row per hierarchy path rooted at ATC1_CODE; lower levels may be null.
-- Write mode : Full refresh (INSERT OVERWRITE).
-- Downstream : dwd.dwd_ims_td_pack_property, dws.dws_ims_td_atc_cn
-- Replaces : dwd.dwd_ims_atc_hierarchy (legacy output).
-- Consumers : Pack-property and ATC-CN jobs must migrate to the DWS target.
-- Notes : Parent-code matching is preserved from the legacy script.
-- =============================================================================
INSERT OVERWRITE TABLE dwd.dwd_ims_atc_hierarchy (
INSERT OVERWRITE TABLE dws.dws_ext_td_ims_atc_hierarchy (
ATC1_ID,
ATC1_CODE,
ATC1_DES,
@@ -2,14 +2,15 @@
-- =============================================================================
-- Purpose : Build the flattened IMS NFC level 1-3 hierarchy.
-- Source : dwd.dwd_ims_td_new_form_class
-- Target : dwd.dwd_ims_nfc_hierarchy
-- Target : dws.dws_ext_td_ims_nfc_hierarchy
-- Grain : One row per hierarchy path rooted at NFC1_CODE; lower levels may be null.
-- Write mode : Full refresh (INSERT OVERWRITE).
-- Downstream : dwd.dwd_ims_td_pack_property, dws.dws_ims_td_nfc_cn
-- Replaces : dwd.dwd_ims_nfc_hierarchy (legacy output).
-- Consumers : Pack-property and NFC-CN jobs must migrate to the DWS target.
-- Notes : Parent-code matching is preserved from the legacy script.
-- =============================================================================
INSERT OVERWRITE TABLE dwd.dwd_ims_nfc_hierarchy (
INSERT OVERWRITE TABLE dws.dws_ext_td_ims_nfc_hierarchy (
NFC1_ID,
NFC1_CODE,
NFC1_DES,