Skip to content

Commit f47e239

Browse files
committed
normalize_data_type: do case-insensitive search
1 parent 7f9f8d7 commit f47e239

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

macros/utils/data_types/normalize_data_type.sql

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,21 @@
66
{%- endif %}
77

88
{%- if data_type is defined and data_type is not none %}
9-
{%- if data_type in elementary.data_type_list('string') %}
9+
{%- if elementary.is_data_type_of_normalized_type(data_type, 'string') %}
1010
{{ return('string') }}
11-
{%- elif data_type in elementary.data_type_list('numeric') %}
11+
{%- elif elementary.is_data_type_of_normalized_type(data_type, 'numeric') %}
1212
{{ return('numeric') }}
13-
{%- elif data_type in elementary.data_type_list('timestamp') %}
13+
{%- elif elementary.is_data_type_of_normalized_type(data_type, 'timestamp') %}
1414
{{ return('timestamp') }}
15-
{%- elif data_type in elementary.data_type_list("boolean") %}
15+
{%- elif elementary.is_data_type_of_normalized_type(data_type, "boolean") %}
1616
{{ return("boolean") }}
1717
{%- else %}
1818
{{ return('other') }}
1919
{% endif %}
2020
{%- endif %}
2121
{% endmacro %}
22+
23+
{% macro is_data_type_of_normalized_type(data_type, normalized_type) %}
24+
{% set data_type_list = elementary.data_type_list(normalized_type) | map('lower') %}
25+
{% do return(data_type | lower in data_type_list) %}
26+
{% endmacro %}

0 commit comments

Comments
 (0)