forked from dbt-labs/dbt-utils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
datatypes.sql
107 lines (75 loc) · 2.13 KB
/
datatypes.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{# string ------------------------------------------------- #}
{%- macro type_string() -%}
{{ return(adapter.dispatch('type_string', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_string() %}
string
{% endmacro %}
{%- macro redshift__type_string() -%}
varchar
{%- endmacro -%}
{% macro postgres__type_string() %}
varchar
{% endmacro %}
{% macro snowflake__type_string() %}
varchar
{% endmacro %}
{# timestamp ------------------------------------------------- #}
{%- macro type_timestamp() -%}
{{ return(adapter.dispatch('type_timestamp', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_timestamp() %}
timestamp
{% endmacro %}
{% macro postgres__type_timestamp() %}
timestamp without time zone
{% endmacro %}
{% macro snowflake__type_timestamp() %}
timestamp_ntz
{% endmacro %}
{# float ------------------------------------------------- #}
{%- macro type_float() -%}
{{ return(adapter.dispatch('type_float', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_float() %}
float
{% endmacro %}
{% macro bigquery__type_float() %}
float64
{% endmacro %}
{# numeric ------------------------------------------------ #}
{%- macro type_numeric() -%}
{{ return(adapter.dispatch('type_numeric', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_numeric() %}
numeric(28, 6)
{% endmacro %}
{% macro bigquery__type_numeric() %}
numeric
{% endmacro %}
{% macro athena__type_numeric() %}
double
{% endmacro %}
{% macro presto__type_numeric() %}
double
{% endmacro %}
{# bigint ------------------------------------------------- #}
{%- macro type_bigint() -%}
{{ return(adapter.dispatch('type_bigint', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_bigint() %}
bigint
{% endmacro %}
{% macro bigquery__type_bigint() %}
int64
{% endmacro %}
{# int ------------------------------------------------- #}
{%- macro type_int() -%}
{{ return(adapter.dispatch('type_int', 'dbt_utils')()) }}
{%- endmacro -%}
{% macro default__type_int() %}
int
{% endmacro %}
{% macro bigquery__type_int() %}
int64
{% endmacro %}