BG_RowHashScd1
Applies to
Platform: Microsoft SQL Server · Snowflake · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Store · Dimensional · Data Mart
BG_RowHashScd1 is the hash of the SCD1 terms of a row. The loader compares it with the stored value and, when it differs, overwrites the SCD1 values of the business key without creating a new version.
Objects that carry it
Store Entity, Entity and Mart Dimension. The term exists only when the object has at least one SCD1 term and Delta Detection is Hash Value Comparison, the default. With Column Comparison, the loader compares the columns and the object has no row hash.
Value
The hash covers the SCD1 terms in the term order of the object. Business keys, identity terms, Default Terms and SCD0 terms are never part of it. It uses the project Hash Algorithm; how the values are prepared and joined is explained in How biGENIUS-X builds hash values. On Oracle, Hash Group Size can build it from group hashes.
You cannot edit or map BG_RowHashScd1.
Data type
- Microsoft SQL Server:
binary(20) - Fabric Warehouse:
varbinary(20) - Oracle:
RAW(20) - Snowflake:
BINARY(32) - Databricks, Databricks dbt and Fabric Lakehouse:
binary
Example
A Store Entity on Microsoft SQL Server has the SCD1 terms CUSTOMER, CUSTOMER_TYPE and CUSTOMER_SINCE, with default hash settings. Its Hashing view calculates:
CAST(HASHBYTES('SHA1', CAST('' AS VARCHAR(MAX))
+ ISNULL([CUSTOMER], N'_NULL_')
+ N'_' + ISNULL([CUSTOMER_TYPE], N'_NULL_')
+ N'_' + ISNULL(CAST([CUSTOMER_SINCE] AS NVARCHAR(4000)),
N'_NULL_'))
AS VARBINARY(20)) AS [BG_RowHashScd1]
The customer with CUSTOMER_ID 2, Fabrikam AG without CUSTOMER_SINCE, changes its CUSTOMER_TYPE from Business to Private in the second load. Its only row is updated in place:
After load CUSTOMER_TYPE BG_RowHashScd1 1 Business 0xC30414DA639E2317F6C462216ED968E86A505BD5 2 Private 0x49159AC62FF1CFADDE96EA0F12C63C7FC5917DE4
Release differences
- Generator 2.2: Databricks and Fabric Lakehouse use
binary. Up to Generator 2.0 the type wasstring. - Generator 2.4: Snowflake uses
BINARY(32). Up to Generator 2.3 the type was numeric.
Related articles
- Reference: BG_RowHashScd2, Hash Algorithm (Project), Delta Detection (Model Object), Hash Group Size (Model Object)
- See also: How biGENIUS-X builds hash values, Store Entity, Entity, Mart Dimension