Hash settings
DeltaVault builds the surrogate keys for your Data Vault hubs and links by hashing their business key columns, and it detects row changes by hashing the descriptive columns. The Hash settings control which algorithm does that hashing and the exact SQL DeltaVault generates for it. Most teams pick the algorithm once and leave the rest alone, because DeltaVault fills in the SQL and keeps it matched to your target platform.
This page explains each field, how the SQL is generated, and the two things to watch for if you edit the SQL by hand.
Where you configure them
Section titled “Where you configure them”Open Settings from the left sidebar, choose the Shared section on the left, and find the Hash card below the main Shared settings. Hash settings are organization-wide: they apply to every project in your organization, and editing them requires the administrator role.
The fields
Section titled “The fields”The Hash card has six fields. The top row holds the three you are most likely to set yourself; the three SQL fields below are generated for you from the algorithm.
Hash algorithm picks the hash function used to build hub and link keys and change hashes. You can choose MD5, SHA1, SHA2 224, SHA2 256, SHA2 384, or SHA2 512. SHA2 256 is the common choice. Changing the algorithm rewrites the three SQL fields below it automatically.
Hash null value is the text DeltaVault substitutes for a NULL before hashing, so a NULL column contributes a consistent, deterministic value instead of turning the whole hash into NULL. It starts empty. Set it to a sentinel such as a tilde if you want NULLs to hash to an explicit marker.
Hash delimiter is the separator placed between key column values when they are joined into the single string that gets hashed. It keeps the values apart, so that two columns cannot run together and collide with a different pair of values.
Hash column expression is the SQL that assembles the key columns into one string, using the delimiter. By default it reads CONCAT_WS('{{delimiter}}', {{columns}}). The {{delimiter}} and {{columns}} markers are filled in when DeltaVault generates a pipeline.
Hash transformation is the SQL hash function wrapped around that assembled string. This is the field that changes the most between platforms (a Databricks transformation looks different from a Snowflake one). The {{this}} marker stands for the assembled string from the column expression.
Hash data type is the column type DeltaVault declares for the stored hash, such as BINARY(32). The size follows the algorithm: a SHA2 256 hash is 32 bytes, a SHA2 512 hash is 64 bytes, and so on.
How the SQL is generated
Section titled “How the SQL is generated”When you pick an algorithm, DeltaVault primes the three SQL fields for it, using your organization’s target platform so the SQL is valid for the database you generate against. The column expression is the same everywhere; the transformation and the data type are what adapt.
| Algorithm | Databricks and Fabric transformation | Snowflake transformation | Data type |
|---|---|---|---|
| MD5 | UNHEX(MD5({{this}})) | MD5_BINARY({{this}}) | BINARY(16) |
| SHA1 | UNHEX(SHA1({{this}})) | SHA1_BINARY({{this}}) | BINARY(20) |
| SHA2 224 | UNHEX(SHA2({{this}}, 224)) | SHA2_BINARY({{this}}, 224) | BINARY(28) |
| SHA2 256 | UNHEX(SHA2({{this}}, 256)) | SHA2_BINARY({{this}}, 256) | BINARY(32) |
| SHA2 384 | UNHEX(SHA2({{this}}, 384)) | SHA2_BINARY({{this}}, 384) | BINARY(48) |
| SHA2 512 | UNHEX(SHA2({{this}}, 512)) | SHA2_BINARY({{this}}, 512) | BINARY(64) |
All three target platforms support every algorithm, so any combination you choose generates valid SQL.
To restore the generated SQL after you have changed it, use Reset hash SQL to default. It re-primes the column expression, transformation, and data type from the current algorithm and your target platform, and it leaves the algorithm, null value, and delimiter as they are.
Changing the target platform
Section titled “Changing the target platform”Your target platform (Databricks, Snowflake, or Microsoft Fabric) is set elsewhere in settings, and the hash SQL has to match it. When you change your target platform, DeltaVault re-primes the hash column expression, transformation, and data type to the new platform’s dialect automatically, so you do not have to touch the Hash card. Your algorithm, null value, and delimiter are kept.
If you have hand-edited the hash SQL, changing the target platform replaces those edits with freshly generated SQL for the new platform. The null value and delimiter are preserved, but a custom column expression, transformation, or data type is overwritten. Note your customizations before you switch platforms, and re-apply them afterward.
Editing the SQL by hand
Section titled “Editing the SQL by hand”You can edit the three SQL fields directly when you need something the generated SQL does not give you. Two things to expect:
- After any manual edit, the card shows a note that your hash SQL differs from the generated default. This is informational, not an error: it is telling you the SQL no longer matches what the algorithm would produce. If you edited deliberately, you can ignore it.
- Both Reset hash SQL to default and a target-platform change regenerate the SQL and replace your edits. If a customization matters, keep a copy of it so you can re-apply it.