Skip to content

Commit 5a310e0

Browse files
committed
added dremio data_type_list
1 parent 3a4b2ee commit 5a310e0

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

macros/utils/data_types/data_type_list.sql

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
{%- else %}
130130
{{ return([]) }}
131131
{%- endif %}
132-
132+
133133
{% endmacro %}
134134

135135
{% macro clickhouse__data_type_list(data_type) %}
@@ -151,3 +151,23 @@
151151
{%- endif %}
152152

153153
{% endmacro %}
154+
155+
{% macro dremio__data_type_list(data_type) %}
156+
{% set string_list = ['VARCHAR', 'CHARACTER VARYING'] | list %}
157+
{% set numeric_list = ['INT','INTEGER','BIGINT','DOUBLE','DECIMAL','FLOAT','SMALLINT','TINYINT'] | list %}
158+
{% set timestamp_list = ['DATE','TIME','TIMESTAMP', 'TIME WITH TIME ZONE', 'TIMESTAMP WITH TIME ZONE'] | list %}
159+
{% set boolean_list = ['BOOLEAN', 'BIT'] | list %}
160+
161+
{%- if data_type == 'string' %}
162+
{{ return(string_list) }}
163+
{%- elif data_type == 'numeric' %}
164+
{{ return(numeric_list) }}
165+
{%- elif data_type == 'timestamp' %}
166+
{{ return(timestamp_list) }}
167+
{%- elif data_type == "boolean" %}
168+
{{ return(boolean_list) }}
169+
{%- else %}
170+
{{ return([]) }}
171+
{%- endif %}
172+
173+
{% endmacro %}

0 commit comments

Comments
 (0)