{% macro json_extract(json, paths) %}
CASE
{% for path in paths.split(',') %}
WHEN JSON_PARSE({{ json }}), {{ path }} IS NOT NULL
THEN JSON_PARSE({{ json }}), {{ path }}
{% endfor %}
ELSE NULL
END
{% endmacro %}
I'm trying to build a macros in my dbt to extract multiple path so I could invoke the macros in my model. Everything I've tried is not working.
This is the last macros I built which is not working still.