Skip to content
  • There are no suggestions because the search field is empty.

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

PlatformType
Microsoft SQL Serverbinary(20)
Fabric Warehousevarbinary(20)
OracleRAW(20)
Snowflake, Snowflake dbtBINARY(32)
Databricks, Databricks dbt, Fabric Lakehousebinary

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 was HASH with 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 were string.

Related articles