dbt-firebolt 1.6.3__tar.gz → 1.6.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/PKG-INFO +1 -1
  2. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/__init__.py +1 -1
  3. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/adapters.sql +10 -11
  4. dbt_firebolt-1.6.4/dbt/include/firebolt/macros/catalog.sql +23 -0
  5. dbt_firebolt-1.6.4/dbt/include/firebolt/macros/dbt_external_tables/create_external_table.sql +137 -0
  6. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt_firebolt.egg-info/PKG-INFO +1 -1
  7. dbt_firebolt-1.6.3/dbt/include/firebolt/macros/catalog.sql +0 -33
  8. dbt_firebolt-1.6.3/dbt/include/firebolt/macros/dbt_external_tables/create_external_table.sql +0 -35
  9. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/LICENSE +0 -0
  10. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/MANIFEST.in +0 -0
  11. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/README.md +0 -0
  12. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/__version__.py +0 -0
  13. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/column.py +0 -0
  14. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/connections.py +0 -0
  15. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/impl.py +0 -0
  16. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/adapters/firebolt/relation.py +0 -0
  17. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/__init__.py +0 -0
  18. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/dbt_project.yml +0 -0
  19. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/adapters/apply_grants.sql +0 -0
  20. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/adapters/relation.sql +0 -0
  21. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/dbt_external_tables/dropif.sql +0 -0
  22. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/dbt_external_tables/get_external_build_plan.sql +0 -0
  23. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/clone.sql +0 -0
  24. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/materialized_view.sql +0 -0
  25. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/column_helpers.sql +0 -0
  26. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/incremental.sql +0 -0
  27. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/is_incremental.sql +0 -0
  28. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/merge.sql +0 -0
  29. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/on_schema_change.sql +0 -0
  30. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/models/incremental/strategies.sql +0 -0
  31. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/seed.sql +0 -0
  32. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/table.sql +0 -0
  33. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/test.sql +0 -0
  34. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/materializations/view.sql +0 -0
  35. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/array_append.sql +0 -0
  36. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/array_concat.sql +0 -0
  37. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/array_construct.sql +0 -0
  38. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/bool_or.sql +0 -0
  39. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/cast_bool_to_text.sql +0 -0
  40. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/dateadd.sql +0 -0
  41. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/datediff.sql +0 -0
  42. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/except.sql +0 -0
  43. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/intersect.sql +0 -0
  44. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/listagg.sql +0 -0
  45. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/position.sql +0 -0
  46. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/right.sql +0 -0
  47. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/split_part.sql +0 -0
  48. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt/include/firebolt/macros/utils/timestamps.sql +0 -0
  49. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt_firebolt.egg-info/SOURCES.txt +0 -0
  50. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt_firebolt.egg-info/dependency_links.txt +0 -0
  51. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt_firebolt.egg-info/requires.txt +0 -0
  52. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/dbt_firebolt.egg-info/top_level.txt +0 -0
  53. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/pyproject.toml +0 -0
  54. {dbt_firebolt-1.6.3 → dbt_firebolt-1.6.4}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbt_firebolt
3
- Version: 1.6.3
3
+ Version: 1.6.4
4
4
  Summary: The Firebolt adapter plugin for dbt (data build tool)
5
5
  Home-page: https://github.com/firebolt-db/dbt-firebolt
6
6
  Author: Firebolt
@@ -7,7 +7,7 @@ from dbt.adapters.firebolt.connections import (
7
7
  from dbt.adapters.firebolt.impl import FireboltAdapter
8
8
  from dbt.include import firebolt
9
9
 
10
- __version__ = "1.6.3"
10
+ __version__ = "1.6.4"
11
11
 
12
12
  Plugin = AdapterPlugin(
13
13
  adapter=FireboltAdapter, # type: ignore
@@ -168,17 +168,16 @@
168
168
  #}
169
169
  {% call statement('list_tables_without_caching', fetch_result=True) %}
170
170
 
171
- SELECT '{{ relation.database }}' AS "database",
172
- table_name AS "name",
173
- '{{ relation.schema }}' AS "schema",
174
- 'table' AS type
175
- FROM information_schema.tables
176
- UNION ALL
177
- SELECT '{{ relation.database }}' AS "database",
178
- table_name AS "name",
179
- '{{ relation.schema }}' AS "schema",
180
- 'view' AS type
181
- FROM information_schema.views
171
+ SELECT
172
+ table_catalog AS "database",
173
+ table_name AS "name",
174
+ '{{ relation.schema }}' AS "schema",
175
+ CASE
176
+ WHEN table_type = 'VIEW' THEN 'view'
177
+ ELSE 'table'
178
+ END AS "type"
179
+ FROM
180
+ information_schema.tables
182
181
  {% endcall %}
183
182
  {% set info_table = load_result('list_tables_without_caching').table %}
184
183
  {{ return(info_table) }}
@@ -0,0 +1,23 @@
1
+ {# This is for building docs. Right now it's an incomplete description of
2
+ the columns (for instance, `is_nullable` is missing) but more could be added later. #}
3
+
4
+ {% macro firebolt__get_catalog(information_schemas, schemas) -%}
5
+ {%- call statement('catalog', fetch_result=True) %}
6
+ SELECT
7
+ tbls.table_catalog AS table_database,
8
+ tbls.table_schema as table_schema,
9
+ table_type,
10
+ tbls.table_name as table_name,
11
+ cols.column_name as column_name,
12
+ cols.data_type AS column_type,
13
+ CASE
14
+ WHEN table_type = 'VIEW' THEN 'VIEW'
15
+ ELSE 'TABLE'
16
+ END AS relation_type,
17
+ cols.ordinal_position as column_index
18
+ FROM
19
+ information_schema.tables tbls
20
+ JOIN information_schema.columns cols USING (table_name)
21
+ {% endcall -%}
22
+ {{ return(load_result('catalog').table) }}
23
+ {%- endmacro %}
@@ -0,0 +1,137 @@
1
+ {% macro firebolt__create_external_table(source_node) %}
2
+ {% if source_node.external.strategy == 'copy' %}
3
+ {{ firebolt__create_with_copy_from(source_node) }}
4
+ {% else %}
5
+ {{ firebolt__create_with_external_table(source_node) }}
6
+ {% endif %}
7
+ {% endmacro %}
8
+
9
+ {% macro firebolt__create_with_external_table(source_node) %}
10
+ {%- set external = source_node.external -%}
11
+ {%- if 'partitions' in external -%}
12
+ {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
13
+ external.partitions) -%}
14
+ {%- else -%}
15
+ {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
16
+ []) -%}
17
+ {%- endif -%}
18
+ {%- set credentials = external.credentials -%}
19
+ {# Leaving out "IF NOT EXISTS" because this should only be called by
20
+ if no DROP IF is necessary. #}
21
+ CREATE EXTERNAL TABLE {{source(source_node.source_name, source_node.name)}} (
22
+ {%- for column in columns -%}
23
+ {{ column }}
24
+ {{- ',' if not loop.last }}
25
+ {% endfor -%}
26
+ )
27
+ {% if external.url %} URL = '{{external.url}}' {%- endif %}
28
+ {%- if credentials and credentials.internal_role_arn %}
29
+ CREDENTIALS = (AWS_ROLE_ARN = '{{credentials.internal_role_arn}}'
30
+ {%- if credentials.external_role_id %}
31
+ AWS_ROLE_EXTERNAL_ID = '{{credentials.external_role_id}}'
32
+ {%- endif -%}
33
+ )
34
+ {% elif credentials and credentials.aws_key_id %}
35
+ CREDENTIALS = (AWS_KEY_ID = '{{credentials.aws_key_id}}'
36
+ AWS_SECRET_KEY = '{{credentials.aws_secret_key}}')
37
+ {%- endif %}
38
+ {%- if external.object_pattern -%} OBJECT_PATTERN = '{{external.object_pattern}}' {%- endif %}
39
+ {% if external.object_patterns -%}
40
+ OBJECT_PATTERN =
41
+ {%- for obj in external.object_patterns -%}
42
+ {{ obj }}
43
+ {{- ',' if not loop.last }}
44
+ {%- endfor %}
45
+ {%- endif %}
46
+ {%- if external.compression -%} COMPRESSION = {{external.compression}} {%- endif %}
47
+ TYPE = {{ external.type }}
48
+ {% endmacro %}
49
+
50
+ {% macro firebolt__create_with_copy_from(source_node) %}
51
+ {# COPY FROM is only available in Firebolt 2.0. #}
52
+ {%- set external = source_node.external -%}
53
+ {%- set credentials = external.credentials -%}
54
+ {%- set options = external.options -%}
55
+ {%- set csv_options = options.csv_options -%}
56
+ {%- set error_file_credentials = options.error_file_credentials -%}
57
+
58
+ {# There are no partitions, but this formats the columns correctly. #}
59
+ {%- if 'partitions' in external -%}
60
+ {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
61
+ external.partitions) -%}
62
+ {%- else -%}
63
+ {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
64
+ []) -%}
65
+ {%- endif -%}
66
+ COPY INTO {{source(source_node.source_name, source_node.name)}}
67
+ {%- if columns and columns | length > 0 %}
68
+ (
69
+ {%- for column in columns -%}
70
+ {{ column.name }}
71
+ {%- if column.default is not none %} DEFAULT {{ column.default }}{% endif %}
72
+ {%- if column.source_column_name is not none %} {{ '$' ~ loop.index0 }}{% endif %}
73
+ {{- ',' if not loop.last }}
74
+ {%- endfor -%}
75
+ )
76
+ {%- endif %}
77
+ FROM '{{external.url}}'
78
+ {%- if options %}
79
+ WITH
80
+ {%- if options.object_pattern %}
81
+ PATTERN = '{{options.object_pattern}}'
82
+ {%- endif %}
83
+ {%- if options.type %}
84
+ TYPE = {{ options.type }}
85
+ {%- endif %}
86
+ {%- if options.auto_create is not none %}
87
+ AUTO_CREATE = {{ options.auto_create | upper }}
88
+ {%- endif %}
89
+ {%- if options.allow_column_mismatch is not none %}
90
+ ALLOW_COLUMN_MISMATCH = {{ options.allow_column_mismatch | upper }}
91
+ {%- endif %}
92
+ {%- if options.error_file %}
93
+ ERROR_FILE = '{{ options.error_file }}'
94
+ {%- endif %}
95
+ {%- if error_file_credentials %}
96
+ ERROR_FILE_CREDENTIALS = (AWS_KEY_ID = '{{ error_file_credentials.aws_key_id }}' AWS_SECRET_KEY = '{{ error_file_credentials.aws_secret_key }}')
97
+ {%- endif %}
98
+ {%- if options.max_errors_per_file %}
99
+ MAX_ERRORS_PER_FILE = {{ options.max_errors_per_file }}
100
+ {%- endif %}
101
+ {%- if csv_options %}
102
+ {%- if csv_options.header is not none %}
103
+ HEADER = {{ csv_options.header | upper }}
104
+ {%- endif %}
105
+ {%- if csv_options.delimiter %}
106
+ DELIMITER = '{{ csv_options.delimiter }}'
107
+ {%- endif %}
108
+ {%- if csv_options.newline %}
109
+ NEWLINE = '{{ csv_options.newline }}'
110
+ {%- endif %}
111
+ {%- if csv_options.quote %}
112
+ QUOTE = {{ csv_options.quote }}
113
+ {%- endif %}
114
+ {%- if csv_options.escape %}
115
+ ESCAPE = '{{ csv_options.escape }}'
116
+ {%- endif %}
117
+ {%- if csv_options.null_string %}
118
+ NULL_STRING = '{{ csv_options.null_string }}'
119
+ {%- endif %}
120
+ {%- if csv_options.empty_field_as_null is not none %}
121
+ EMPTY_FIELD_AS_NULL = {{ csv_options.empty_field_as_null | upper }}
122
+ {%- endif %}
123
+ {%- if csv_options.skip_blank_lines is not none %}
124
+ SKIP_BLANK_LINES = {{ csv_options.skip_blank_lines | upper }}
125
+ {%- endif %}
126
+ {%- if csv_options.date_format %}
127
+ DATE_FORMAT = '{{ csv_options.date_format }}'
128
+ {%- endif %}
129
+ {%- if csv_options.timestamp_format %}
130
+ TIMESTAMP_FORMAT = '{{ csv_options.timestamp_format }}'
131
+ {%- endif %}
132
+ {%- endif %}
133
+ {%- endif %}
134
+ {%- if credentials %}
135
+ CREDENTIALS = (AWS_KEY_ID = '{{credentials.aws_key_id}}' AWS_SECRET_KEY = '{{credentials.aws_secret_key}}')
136
+ {%- endif %}
137
+ {% endmacro %}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dbt-firebolt
3
- Version: 1.6.3
3
+ Version: 1.6.4
4
4
  Summary: The Firebolt adapter plugin for dbt (data build tool)
5
5
  Home-page: https://github.com/firebolt-db/dbt-firebolt
6
6
  Author: Firebolt
@@ -1,33 +0,0 @@
1
- {# This is for building docs. Right now it's an incomplete description of
2
- the columns (for instance, `is_nullable` is missing) but more could be added later. #}
3
-
4
- {% macro firebolt__get_catalog(information_schemas, schemas) -%}
5
- {%- call statement('catalog', fetch_result=True) %}
6
- SELECT tbls.table_catalog AS table_database
7
- , tbls.table_schema as table_schema
8
- , table_type
9
- , tbls.table_name as table_name
10
- , cols.column_name as column_name
11
- , cols.data_type AS column_type
12
- , UPPER(tbls.table_type) as relation_type
13
- , cols.ordinal_position as column_index
14
- FROM information_schema.tables tbls
15
- JOIN information_schema.columns cols
16
- USING(table_name)
17
-
18
- UNION ALL
19
-
20
- SELECT views.table_catalog AS table_database
21
- , views.table_schema as table_schema
22
- , 'VIEW' AS table_type
23
- , views.table_name as table_name
24
- , cols.column_name AS column_name
25
- , cols.data_type AS column_type
26
- , 'VIEW' as relation_type
27
- , cols.ordinal_position as column_index
28
- FROM information_schema.views views
29
- JOIN information_schema.columns cols
30
- USING(table_name)
31
- {% endcall -%}
32
- {{ return(load_result('catalog').table) }}
33
- {%- endmacro %}
@@ -1,35 +0,0 @@
1
- {% macro firebolt__create_external_table(source_node) %}
2
- {%- set external = source_node.external -%}
3
- {%- if 'partitions' in external -%}
4
- {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
5
- external.partitions) -%}
6
- {%- else -%}
7
- {%- set columns = adapter.make_field_partition_pairs(source_node.columns.values(),
8
- []) -%}
9
- {%- endif -%}
10
- -- {%- set partitions = external.partitions -%}
11
- {%- set credentials = external.credentials -%}
12
- {# Leaving out "IF NOT EXISTS" because this should only be called by
13
- if no DROP IF is necessary. #}
14
- CREATE EXTERNAL TABLE {{source(source_node.source_name, source_node.name)}} (
15
- {%- for column in columns -%}
16
- {{ column }}
17
- {{- ',' if not loop.last }}
18
- {% endfor -%}
19
- )
20
- {% if external.url %} URL = '{{external.url}}' {%- endif %}
21
- {%- if credentials %}
22
- CREDENTIALS = (AWS_ROLE_ARN = '{{credentials.internal_role_arn}}'
23
- AWS_ROLE_EXTERNAL_ID = '{{credentials.external_role_id}}')
24
- {% endif %}
25
- {%- if external.object_pattern -%} OBJECT_PATTERN = '{{external.object_pattern}}' {%- endif %}
26
- {% if external.object_patterns -%}
27
- OBJECT_PATTERN =
28
- {%- for obj in external.object_patterns -%}
29
- {{ obj }}
30
- {{- ',' if not loop.last }}
31
- {%- endfor %}
32
- {%- endif %}
33
- {%- if external.compression -%} COMPRESSION = {{external.compression}} {%- endif %}
34
- TYPE = {{ external.type }}
35
- {% endmacro %}
File without changes
File without changes
File without changes
File without changes