Dimension Table Loading Pattern
The Dimension Load Pattern is configured in the metadata in a Data Mart project.
The load has a Source Object, normally an abstraction view, a staging table or a Data Vault construct.
The source object has an Integration Key set that is used for Dimension Lookups
The target Dimension Object can be cloned from the Source Object. The target has an additional Sequence Identified (Identity Column) added as the Primary Key of the Dimension.
The ETL Pattern is implemented in, and orchestrated through, SSIS.
Dimension Load ETL Pattern for Type 1 Dimensions, implemented in the SSIS package
- SQL - Truncate target Data Mart Staging Table
- SQL - Check for initial load by checking if there is data in the target table
- DFT - Data Flow to Load Target Table
- SRC - Select from Source Object
- FLX - Row Count
- DC - Add Audit Columns
- FLX - Hash for Type 1 Attributes
- LKP - Lookup Surrogate Key
- DC - Derived Surrogate Defaults when needed
- DC - Insert Defaults if needed
- FLX - Row Count
- DST - Load Destination Staging Table, and Dimension Table at Initial Load
- SQL - Merge Staged data into Target Table for non-initial loads
Dimension Load ETL Pattern for Type 2 Dimensions, implemented in the SSIS package
- SQL - Truncate target Data Mart Staging Table
- SQL - Check for initial load by checking if there is data in the target table
- DFT - Data Flow to Load Target Table
- SRC - Select from Source Object
- FLX - Row Count
- DC - Add Audit Columns
- FLX - Hash for Type 1 Attributes
- FLX - Hash for Type 2 Attributes
- LKP - Lookup Surrogate Key
- DC - Derived Surrogate Defaults when needed
- CSPL - Split processing based on type of change (Type 1, Type 2, etc)
- DC - Insert/Update Defaults if needed, as per Change Type
- FLX - Row Count
- DST - Load Destination Staging Table, and Dimension Table at Initial Load
- SQL - Merge Staged data into Target Table for non-initial loads
Dimension ELT Patterns
The ELT Pattern is implemented in SQL and orchestrated through SSIS or ADF as needed.
Dimension Load ELT Pattern for Type 1 Dimensions, implemented in a Stored Procedure
- Select into initial temporary Stage Derive Attribute Hash as needed
- Create Temporary Upsert Table from Stage and Target
- Update any existing, changed rows
- Insert any new rows
Dimension Load ELT Pattern for Type 2 Dimensions, implemented in a Stored Procedure
- Select into initial temporary Stage Derive Attribute Hash as needed for Type 1 and Type 2 sets Derive Metadata as required
- Insert new and Type 2 changed rows in target
- End Date any Type 2 changes Dimensions have their rows Effective To and the next rows Effective From separated by a millisecond
- Create Temporary Upsert Table from Stage and Target for Type 1 changes
- Update any existing, changed Type 1 Attributes