diff --git a/macros/streamline/configs.yaml.sql b/macros/streamline/configs.yaml.sql index dfb8575..59d0949 100644 --- a/macros/streamline/configs.yaml.sql +++ b/macros/streamline/configs.yaml.sql @@ -68,6 +68,20 @@ sql: | {{ python_udf_hex_to_int_with_encoding() | indent(4) }} +- name: utils.udf_hex_to_string + signature: + - [hex, STRING] + return_type: TEXT + options: | + NULL + LANGUAGE SQL + STRICT IMMUTABLE + sql: | + SELECT + LTRIM(regexp_replace( + try_hex_decode_string(hex), + '[\x00-\x1F\x7F-\x9F\xAD]', '', 1)) + {# LIVE SCHEMA #} @@ -105,6 +119,5 @@ secret_name ) - {% endmacro %}