Data Mart families
Two families write the mart layer: the dimension load and the fact load. Both
load from exactly one designer-authored view, and both strip the mart prefix
from this.name because the template re-adds its own.
mart-dimension
Section titled “mart-dimension”Templates: databricks/data_mart/dimension.jinja
Roots: this, cdc, source, sources
The dimension load. A mart table loads from exactly one designer-authored
view, so sources is always a one-element list: honest, not padding. One
naming rule is load-bearing: this.name is the bare name with the mart prefix
stripped, because the template re-adds its own prefix (an unstripped name would
produce dim_dim_customer).
| Field | Type | Meaning |
|---|---|---|
this.name | string | The prefix-stripped bare name. |
this.physicalName | string | The finished physical name: the dim prefix joined to the snake-cased bare name. |
this.fqn | string | The stored fully qualified name as the catalog row carries it (no mart body reads it). |
this.columns[] | array | The mart table’s own columns. |
this.description | string | The table comment, rendered as the object’s COMMENT; empty when absent. |
this.transformation.grainColumn | string? | The declared grain column, when set. |
source | view ref | The designer view this dimension loads from: name, nameSnakeCase (read inside table_changes), fqn (dialect-cased), columns (ordinal-sorted; empty when unresolvable), ulid when resolved. Identical object to sources[0]. |
cdc.keys | string[] | The change-feed KEYS; never empty after a successful resolve. |
cdc.keysClause | string | The keys joined with a comma, precomputed. |
cdc.sequenceBy | string | The SEQUENCE BY column; default _commit_timestamp. |
cdc.applyAsDeleteWhen | string? | Conditional: the APPLY AS DELETE WHEN expression; absent when the tombstone handling emits none (soft delete and ignore emit none; delete_row and unset emit _change_type = 'delete'). |
cdc.exceptColumns | string[] | Columns excluded from the tracked set. |
cdc.scdType | 1 or 2 | Slowly-changing-dimension type the load deploys as. |
cdc.trackHistoryColumns | string[]? | Explicit history-tracking columns; only ever set by an override. |
mart-fact
Section titled “mart-fact”Templates: databricks/data_mart/fact.jinja
Roots: this, excludedColNames, dimRefs, source, sources
The fact load. this and source follow mart-dimension exactly (the physical
name uses the fact prefix). What is specific here is the dimension join model.
| Field | Type | Meaning |
|---|---|---|
excludedColNames | string[] | Columns the fact’s main column loop must skip: every dimension reference’s surrogate key column, plus the grain column when set (the grain branch re-emits it once and last; selecting it in the loop too would duplicate it and the platform would reject the statement). |
dimRefs[] | array | One entry per joined reference dimension. |
dimRefs[].name | string | The role name, or the dimension’s bare name when no role is declared. |
dimRefs[].tableName | string | The dimension’s bare (prefix-stripped) name. |
dimRefs[].surrogateKeyColumn | string | The dimension column holding the surrogate key; validated at build time against the dimension’s real columns. |
dimRefs[].businessKey | string | The business key the fact joins on. |
dimRefs[].scdType | number | The dimension’s slowly-changing-dimension type; type 2 adds the current-row filter (__END_AT IS NULL). |
dimRefs[].alias | string | The join’s SQL alias: d_ plus the snake-cased role name. |
dimRefs[].surrogateKeyAlias | string | The output column the surrogate key is selected as: the snake-cased role name plus _sk. |
dimRefs[].dimensionPhysicalName | string | The physical dimension table the join targets. |