macro test

This commit is contained in:
drethereum 2023-05-22 15:38:21 -06:00
parent 99ef480bc7
commit 2dc8527001

View File

@ -0,0 +1,12 @@
{% macro create_udf_hex_to_string(schema) %}
CREATE OR REPLACE FUNCTION {{ schema }}.udf_hex_to_string(hex STRING)
RETURNS TEXT
LANGUAGE SQL
STRICT IMMUTABLE AS
$$
SELECT
LTRIM(regexp_replace(
try_hex_decode_string(hex),
'[\x00-\x1F\x7F-\x9F\xAD]', '', 1))
$$;
{% endmacro %}