dbt-selly-express/macros/cross_db_utils/hash.sql

5 lines
201 B
MySQL
Raw Normal View History

2022-03-21 14:00:47 +00:00
{# converting hash in varchar _macro #}
{% macro sqlserver__hash(field) -%}
convert(varchar(32), HashBytes('md5', coalesce(cast({{field}} as {{dbt_utils.type_string()}}), '')), 2)
{%- endmacro %}