Dimension Loading Pattern
The Dimension Load Pattern is configured in the BimlFlex metadata in a Data Mart Project. This is a project where the Target Connection has an Integration Stage of Data Mart
.
The Source Connection for the project can be a view, Staging Area object, or a Data Vault construct.
The Integration Key for the source object (the object(s) in the source connection) will be used for Dimension key 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.
SSIS 'ETL' Implementation
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 depending on the Integration Template of the Project.
The pattern for Type 1 Dimension loading, as implemented in a Stored Procedure, is as follows:
- Select into initial temporary Staging table Derive Attribute Hash as needed
- Create Temporary 'Upsert' Table from Stage and Target
- Update any existing, changed rows
- Insert any new rows
The pattern for Type 1 Dimension loading, as implemented in a Stored Procedure, is as follows:
- Select into initial temporary Stage Derive Attribute Hash as needed for Type 1 and Type 2 column 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