DVLINK_ForeignKey_Identity
Applies to
Platform: Microsoft SQL Server · Snowflake · Snowflake dbt · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Vault
DVLINK_ForeignKey_Identity is the hash foreign key of a Link to one of its Hubs. A Link has one such term per Hub relationship, and its value equals the Hub_HK of the referenced Hub row.
Objects that carry it
Link, Driving Key Link, Hierarchical Link, Same As Link and their Business Vault counterparts. The term is created for each relationship from the Link to a Hub, not when the Link itself is created.
Its name has the form <Hub name>_<role>_HK in the generated tables, for example common_employee_EMPLOYEE_HK. Here <Hub name> is the referenced Hub and <role> the role of the relationship.
Value
The Hashing view hashes the foreign-key terms of the relationship in the term order of the Hub, with the project Hash Algorithm. The Hub hashes its business keys in the same way, so both values match.
When all foreign-key terms of the relationship are nullable and all of them are NULL, the value is the unknown-member key of zero bytes. Projects that still use the setting Nulled Business Keys Point to Non-Existing Hub Key of Behaviour for Nulled Business Keys in Links hash the NULL values instead.
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 with the role EMPLOYEE. Its 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 [common_employee_EMPLOYEE_HK]
For employee 7 the Link row holds 0x7402F76B2D6078A455F77607AF6E7350B6DE019E. The Multi-Active Satellite of the employee Hub stores the same value as Hub_HK for employee 7.
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: Link_HK, Hub_HK, Hash Algorithm (Project), Behaviour for Nulled Business Keys in Links (Project)
- See also: How biGENIUS-X builds hash values, Create a Link, Create a Driving Key Link