diff --git a/src/template/check_yaml.sql b/src/template/check_yaml.sql index 7465292..6bf1e19 100644 --- a/src/template/check_yaml.sql +++ b/src/template/check_yaml.sql @@ -34,5 +34,5 @@ CREATE OR REPLACE FUNCTION COMMENT = 'Parses and validates a YAML string.' AS $$ - TO_VARCHAR(CHECK_YAML_ARRAY(TO_BINARY(YAML_STRING, 'UTF-8')), 'UTF-8') +CASE WHEN YAML_STRING IS NULL THEN NULL ELSE TO_VARCHAR(CHECK_YAML_ARRAY(TO_BINARY(YAML_STRING, 'UTF-8')), 'UTF-8') END $$ diff --git a/src/template/yaml_to_json_array.sql b/src/template/yaml_to_json_array.sql index 31c5585..6fdffce 100644 --- a/src/template/yaml_to_json_array.sql +++ b/src/template/yaml_to_json_array.sql @@ -34,5 +34,5 @@ CREATE OR REPLACE FUNCTION COMMENT = 'Parses a YAML string into a semi-structured value.' AS $$ - PARSE_JSON(TO_VARCHAR(YAML_TO_JSON_ARRAY(TO_BINARY(YAML_STRING, 'UTF-8')), 'UTF-8')) +CASE WHEN YAML_STRING IS NULL THEN NULL ELSE PARSE_JSON(TO_VARCHAR(YAML_TO_JSON_ARRAY(TO_BINARY(YAML_STRING, 'UTF-8')), 'UTF-8')) END $$ diff --git a/src/template/yaml_to_json_string.sql b/src/template/yaml_to_json_string.sql index dc03a45..92e6ff9 100644 --- a/src/template/yaml_to_json_string.sql +++ b/src/template/yaml_to_json_string.sql @@ -34,5 +34,5 @@ CREATE OR REPLACE FUNCTION COMMENT = 'Parses a YAML string into a semi-structured value.' AS $$ - PARSE_JSON(YAML_TO_JSON_STRING(YAML_STRING)) +CASE WHEN YAML_STRING IS NULL THEN NULL ELSE PARSE_JSON(YAML_TO_JSON_STRING(YAML_STRING)) END $$