Skip to content

Commit

Permalink
Merge pull request #175 from tkiehn/change-global-var-hash_datatype-t…
Browse files Browse the repository at this point in the history
…o-string

Change global var hash datatype to string
  • Loading branch information
tkirschke authored May 13, 2024
2 parents ac95960 + 1b36152 commit 03cfca4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dbt_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ vars:
datavault4dbt.deleted_flag_alias: 'deleted_flag'
#Hash Configuration
datavault4dbt.hash: 'MD5'
datavault4dbt.hash_datatype: 'BINARY(16)' #changed from string
datavault4dbt.hash_datatype: 'STRING'
datavault4dbt.hashkey_input_case_sensitive: FALSE
datavault4dbt.hashdiff_input_case_sensitive: TRUE

Expand Down
2 changes: 1 addition & 1 deletion macros/staging/synapse/stage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
{#- Setting unknown and error keys with default values for the selected hash algorithm -#}
{%- set hash = datavault4dbt.hash_method() -%}
{{ log('hash_function: ' ~ hash, false)}}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'STRING') -%}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'BINARY(16)') -%}
{%- set hash_default_values = fromjson(datavault4dbt.hash_default_values(hash_function=hash,hash_datatype=hash_dtype)) -%}
{%- set hash_alg = hash_default_values['hash_alg'] -%}
{%- set unknown_key = hash_default_values['unknown_key'] -%}
Expand Down
2 changes: 1 addition & 1 deletion macros/supporting/hash.sql
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
{%- set hashdiff_input_case_sensitive = var('datavault4dbt.hashdiff_input_case_sensitive', TRUE) -%}

{#- Select hashing algorithm -#}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'STRING') -%}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'BINARY(16)') -%}
{{ log('hash type in hash macro: ' ~ hash_dtype, false) }}
{%- set hash_default_values = fromjson(datavault4dbt.hash_default_values(hash_function=hash,hash_datatype=hash_dtype)) -%}
{%- set hash_alg = hash_default_values['hash_alg'] -%}
Expand Down
2 changes: 1 addition & 1 deletion macros/tables/synapse/pit.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{%- macro synapse__pit(tracked_entity, hashkey, sat_names, ldts, ledts, sdts, snapshot_relation, dimension_key,snapshot_trigger_column=none, custom_rsrc=none, pit_type=none) -%}

{%- set hash = var('datavault4dbt.hash', 'MD5') -%}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'STRING') -%}
{%- set hash_dtype = var('datavault4dbt.hash_datatype', 'BINARY(16)') -%}
{%- set hash_default_values = fromjson(datavault4dbt.hash_default_values(hash_function=hash,hash_datatype=hash_dtype)) -%}
{%- set hash_alg = hash_default_values['hash_alg'] -%}
{%- set unknown_key = hash_default_values['unknown_key'] -%}
Expand Down

0 comments on commit 03cfca4

Please sign in to comment.