BG_MAS_HubDifferenceFound
Applies to
Platform: Microsoft SQL Server · Snowflake · Snowflake dbt · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Vault
BG_MAS_HubDifferenceFound is an internal flag of a Multi-Active Satellite. It marks the Hub keys whose set of active rows differs from the load, so that the loader replaces exactly these sets.
Objects that carry it
Multi-Active Satellite, only in its Delta view. It does not appear in the table, and you do not map it.
Value
The Delta view compares the rows of the load with the active rows of the satellite on Hub_HK, BG_RowHash and BG_Sequence. A row that is new, changed or missing on one side is a difference. The flag is the maximum of these differences per Hub key, so it is 1 for every row of a Hub key with at least one difference and 0 otherwise.
The Delta view passes on only the rows of the load with the flag 1. The loader closes the previous set of these Hub keys and inserts the new set.
Data type
- Microsoft SQL Server, Fabric Warehouse:
bit - Oracle:
NUMBER(1) - Snowflake, Snowflake dbt:
BOOLEAN - Databricks, Databricks dbt, Fabric Lakehouse:
integer
Example
On Microsoft SQL Server the Delta view of a Multi-Active Satellite calculates:
MAX(CASE WHEN ISNULL([BG_Source].[BG_RowHash], 0x00)
<> ISNULL([BG_Target].[BG_RowHash], 0x00)
THEN 1 ELSE 0 END)
OVER (PARTITION BY ISNULL([BG_Source].[Hub_HK],
[BG_Target].[Hub_HK])) AS [BG_MAS_HubDifferenceFound]
In a second load, phone number 101 of employee 7 changes and number 202 of employee 8 is missing. Employee 9 is unchanged. The flag is 1 for all rows of employees 7 and 8, so the loader inserts their sequences 101, 102 and 201 again. Employee 9 gets 0 and no new row.
Release differences
- Generator 2.4: the flag is set per Hub key. Up to Generator 2.3 it was set per Hub key and sequence.
Related articles
- Reference: BG_Sequence, BG_RowHash, Hub_HK
- See also: Create a Multi-Active Satellite