Skip to main content
Version: v1.17

GLOBAL VARIABLES


datavault4dbt is highly customizable by using many global variables. Since they are applied on multiple levels, a high rate of standardization across your data vault 2.0 solution is guaranteed.


PREREQUISITES

The default values of those variables are set inside the packages dbt_project.yml under <your_dbt_project>/dbt_packages/datavault4dbt/dbt_project.yml and should be copied to your own dbt_project.yml. Copy all variables defined under the keyword vars, and paste them under the keyword vars in your file.


VARIABLES AND THEIR USAGES

All the following variables are prefixed with datavault4dbt.

GENERAL CONFIGURATION

NameUsageExplanation
include_business_objects_before_appearanceRef TableIf a Ref_Hub entry should appear in the ref_table (snapshot based), even if the snapshot date is before the first appearance of that business object.
enable_static_analysis_overwriteAll macrosRelevant for Fusion compatibility. For more info, see here.
multi_source_models_execution_aware_loadingMulti source entitiesWhether multi source entities should respect the dbt command to reduce runtimes.

COLUMN ALIASES

NameUsageExplanation
ldts_aliasStage, DV entitiesThe name of the load-date column in all DV entities. Is generated in the staging area.
rsrc_aliasStage, DV entitiesThe name of the record-source column in all DV entities. Is generated in the staging area.
ledts_aliasVersion 1 SatellitesThe name of the load-end date column in version 1 Satellites and MA-Satellites.
sdts_aliasSnapshot Table, PITsThe name of the snapshot-date column in the snapshot table (+view) and all PITs.
snapshot_trigger_columnSnapshot Table, PITs, Post-HookThe name of the column that shows the activation state of single snapshots.
stg_aliasRecord Tracking SatelliteThe name of the column that holds info about the staging model of each record.
is_current_col_aliasVersion 1 SatellitesThe name of the column that indicates the current row per hashkey.
is_active_aliasEffectivity Satellite v0The name of the column that marks activity. Generated by the macro.

HASH CONFIGURATION

NameUsageExplanation
hashStageWhat hash algorithm should be used for generating hash values. MD5, SHA1 or SHA2.
hash_datatypeStageThe datatype that hash columns should have. Needs to fit the output of the used hash algorithm.
hashkey_input_case_sensitiveStageWhether the input business keys for hashkey calculation should be case sensitive or not.
hashdiff_input_case_sensitiveStageWhether the input descriptive attributes for hashdiff calculation should be case sensitive or not.
hashdiff_use_trimStageDefine the global default if hashdiff input columns should be wrapped with TRIM() or not. Defaults to true. Available from v1.16.0

STAGE CONFIGURATION

NameUsageExplanation
copy_rsrc_ldts_input_columnsStageWhether the columns that are used for ldts and rsrc should also be inside the stage, or not. If true, the stage would hold the ldts- & rsrc-alias columns, and the original columns. If false, only the aliased columns are kept.

SATELLITE CONFIGURATION

NameUsageExplanation
is_active_datatypeEffectivity Satellite v0Controls the datatype which is used for the is_active-column. Defaults to Bit for Fabric & Synapse, Number on Oracle and Boolean on the remaining adapters. Available from v1.10.0

GHOST RECORD AND ZERO KEY CONFIGURATION

NameUsageExplanation
beginning_of_all_timesStage, Satellites, PITThe timestamp that represents your earliest technical timestamp.
end_of_all_timesStage, Version 1 Satellites, PITThe timestamp that represents your latest technical timestamp. We recommend to not use the maximum possible timestamp of your database.
timestamp_formatStage, Version 1 Satellites, PITThe timestamp format of the two previous variables.
beginning_of_all_times_dateStageThe date that represents your earliest technical date. Used for ghost-record creation of columns with the date-datatype.
end_of_all_times_dateStageThe date that represents your latest technical date. Used for ghost-record creation of columns with the date-datatype.
date_formatStageThe date format of the two previous variables.
default_unknown_rsrcStageThe default unknown value for the record source column you want to use.
default_error_rsrcStageThe default error value for the record source column you want to use.
rsrc_default_dtypeStageThe default datatype that should be used for the two variables above.
stg_default_dtypeRecord Tracking SatelliteThe default datatype for the stg_alias column inside a record tracking satellite.
derived_columns_default_dtypeStageThe default datatype for derived columns, if no other datatype can be detected automatically.

DATATYPE SPECIFIC DEFAULT VALUES

For each datatype there is a default unknown and error value defined. Additionally, an alternative, usually much shorter value is defined. See the applied default values in the table below.

DatatypeError ValueError Value alt.Unknown ValueUnknown Value alt.
STRING(error)e(unknown)u
Numeric-2-1

Those values are best changed by adding a global variable inside your dbt project, that is called following this pattern: datavault4dbt._value_<(alt)>__. If you want to change the default alternative error value for datatype STRING, you would need to set the global variable datavault4dbt.error_value_alt__STRING to your desired value.