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
- SQL - Insert the Unknown and Not applicable rows that are not yet in the Dimension, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
- 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
- SQL - Insert the Unknown and Not applicable rows that are not yet in the Dimension, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
- 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
For a Type 2 change the merge sets
RowIsCurrentto false on the current row and ends it one millisecond before theRowStartDateof the new row whenRowStartDateis a DateTime2, or one day before when it is a Date
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
- Insert the Unknown and Not applicable rows that are not yet in the target, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
- Create Temporary 'Upsert' Table from Stage and Target
- Update any existing, changed rows
- Insert any new rows
The pattern for Type 2 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 the Unknown and Not applicable rows that are not yet in the target, for a dimension published from the Dimensional Accelerator with Add Unknown and Not applicable rows ticked (a date or time dimension made with Add date dimension or Add time dimension takes the two rows from its source view)
- Insert new and Type 2 changed rows in target
- End Date any Type 2 changes
The earlier row of each Integration Key takes the
RowStartDateof the next row as itsRowEndDate, so a row ends on the same value the next row starts on - Create Temporary 'Upsert' Table from Stage and Target for Type 1 changes
- Update any existing, changed Type 1 Attributes