DrivingKeyLink_HK
Applies to
Platform: Microsoft SQL Server · Snowflake · Snowflake dbt · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Vault
DrivingKeyLink_HK is the hash of the business keys that form the driving key of a Driving Key Link. All Link rows that share a driving key have the same value, so the loaders can find the previous relationship of that driving key.
Objects that carry it
- Driving Key Link and Business Driving Key Link.
- Link Satellite, Effectivity Link Satellite, Record Tracking Link Satellite and their Business Vault counterparts.
Every object of these types gets the term when it is created. The generator calculates the value, so you do not map it; you can change its data type in Manage Default Terms.
Value
The Hashing view hashes the foreign-key terms of the relationships that have Driving Key set to true, in their term order, with the project Hash Algorithm. A driving key that consists of one Hub reference therefore has the same value as the Hub_HK of that Hub. Link Satellites of a Driving Key Link hash their foreign-key terms of the driving key in the same way. The unknown-member row has a value that consists of zero bytes only.
Data type
| Platform | Type |
|---|---|
| Microsoft SQL Server | binary(20) |
| Fabric Warehouse | varbinary(20) |
| Oracle | RAW(20) |
| Snowflake, Snowflake dbt | BINARY(32) |
| Databricks, Databricks dbt, Fabric Lakehouse | binary |
The data type must match the length of the selected Hash Algorithm.
Example
A Driving Key Link on Microsoft SQL Server references an employee Hub and a job function Hub. The employee relationship is the driving key, so the Hashing view calculates:
CAST(HASHBYTES('SHA1', CAST('' AS VARCHAR(MAX))
+ ISNULL(CAST([FK_common_employee_EMPLOYEE_EMPLOYEE_ID]
AS NVARCHAR(4000)), N'_NULL_'))
AS VARBINARY(20)) AS [DrivingKeyLink_HK]
Employee 7 changes from job function 2 to 4 in the second load. Both Link rows of employee 7 share the driving key hash:
EMPLOYEE_ID JOBFUNCTION_ID DrivingKeyLink_HK 7 2 0x7402F76B2D6078A455F77607AF6E7350B6DE019E 7 4 0x7402F76B2D6078A455F77607AF6E7350B6DE019E 8 3 0xB16CF3324CA15FF0851B0F99DD86AC638C3E0CAE
Release differences
- Generator 2.4: Snowflake uses SHA2-256 with
BINARY(32)by default. Up to Generator 2.3 the default wasHASHwith a numeric type, see Generators Release - 2.4.0. - Generator 2.2: Databricks and Fabric Lakehouse store hash values as
binary. Up to Generator 2.0 they werestring.
Related articles
- Reference: Hash Algorithm (Project), Link_HK, Hub_HK
- See also: How biGENIUS-X builds hash values, Create a Driving Key Link, Create a Link Satellite