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

Behaviour for Nulled Business Keys in Links (Project)

Applies to
Platform: Microsoft SQL Server · Snowflake · Snowflake dbt · Databricks · Databricks dbt · Fabric Lakehouse · Fabric Warehouse · Oracle
Architecture: Data Vault

Behaviour for Nulled Business Keys in Links (LinkNulledBusinessKeyBehaviour) decides which Hub key a Link stores for NULL business keys. It applies when all business keys of a relationship are NULL, and it keeps the earlier behavior for projects that already hold such Link rows.

Which projects show the property

The property appears only in projects that existed before the current handling of nulled business keys. A migration script added it to their Project Settings, in the Implementation group of the Additional Settings. Newer projects do not show it. They always use the behavior of Nulled Business Keys Point to Hub Singleton and cannot switch.

Values

  • Nulled Business Keys Point to Non-Existing Hub Key: the Link stores the hash of the NULL inputs. No Hub row has this key. This is the earlier behavior.
  • Nulled Business Keys Point to Hub Singleton: the Link stores the key of the unknown-member row of the Hub, so the Link row references an existing Hub row.

Either value applies only to a relationship whose foreign-key terms are all nullable, and only to rows in which all of them are NULL. Other rows get the hash of their values.

Effect on generated output

For a Link with a nullable relationship to the Hub common_loyaltycard, the hashing view on Microsoft SQL Server calculates the Hub key as follows. With Nulled Business Keys Point to Hub Singleton:

CASE WHEN [FK_common_loyaltycard_LOYALTYCARD_LOYALTYCARD_ID] IS NULL
    THEN 0x00
    ELSE CAST(HASHBYTES('SHA1', CAST('' AS VARCHAR(MAX))
        + ISNULL(CAST([FK_common_loyaltycard_LOYALTYCARD_LOYALTYCARD_ID]
            AS NVARCHAR(4000)), N'_NULL_')) AS VARBINARY(20))
END AS [common_loyaltycard_LOYALTYCARD_HK]

0x00 is the Hub key of the unknown-member row. With Nulled Business Keys Point to Non-Existing Hub Key, only the hash expression remains. A NULL then becomes the hash of the Hash Null Placeholder, by default _NULL_.

Changing the value

Switching to Nulled Business Keys Point to Hub Singleton changes the Hub key that the hashing view calculates for Link rows whose business keys are all NULL. Before you switch, correct the existing data, either with a correction script or by reloading the Links with nullable business keys.

Related articles