-
Notifications
You must be signed in to change notification settings - Fork 0
/
meltano.yml
212 lines (212 loc) · 5.91 KB
/
meltano.yml
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
version: 1
send_anonymous_usage_stats: false
default_environment: dev
environments:
- name: dev
env:
DB_LOCATION: /project/data/dev/data.duckdb
- name: test
env:
DB_LOCATION: /project/data/test/data.duckdb
- name: prod
env:
DB_LOCATION: /project/data/prod/data.duckdb
plugins:
extractors:
- name: tap-rest-api-msdk
variant: widen
pip_url: tap-rest-api-msdk
capabilities:
- state
- catalog
- discover
settings:
- name: api_url
kind: string
- name: next_page_token_path
kind: string
- name: pagination_request_style
kind: string
- name: pagination_response_style
kind: string
- name: pagination_page_size
kind: integer
- name: streams
kind: array
- name: path
kind: string
- name: params
kind: object
- name: headers
kind: object
- name: records_path
kind: string
- name: primary_keys
kind: array
- name: replication_key
kind: string
- name: except_keys
kind: array
- name: num_inference_records
kind: integer
config:
api_url: https://earthquake.usgs.gov/fdsnws
- name: tap-rest-api-gie
inherit_from: tap-rest-api-msdk
config:
api_url: https://agsi.gie.eu
headers:
x-key: $ENV_GIE_XKEY
params:
date: $ENV_DATE_GIE
#date: '2023-02-15'
stream_maps:
stg_gie_storage:
key_hash: md5(config['hash_seed'] + (gasDayStart + code))
#__alias__: stg_gie_storage_vX
stg_gie_company:
key_hash: md5(config['hash_seed'] + (gasDayStart + code))
stg_gie_country:
key_hash: md5(config['hash_seed'] + (gasDayStart + code))
stg_gie_region:
key_hash: md5(config['hash_seed'] + (gasDayStart + code))
stream_map_config:
hash_seed: 01AWZh7A6DzGm6iJZZ2T
streams:
- name: stg_gie_storage
path: /api
# headers:
# x-key: XXX
# params:
# date: $ENV_DATE_GIE
# date: '2022-12-31'
primary_keys:
- code
- gasDayStart
records_path: $.data[*].children[*].children[*].children[*]
- name: stg_gie_company
path: /api
primary_keys:
- code
- gasDayStart
records_path: $.data[*].children[*].children[*]
- name: stg_gie_country
path: /api
primary_keys:
- code
- gasDayStart
records_path: $.data[*].children[*]
- name: stg_gie_region
path: /api
primary_keys:
- code
- gasDayStart
records_path: $.data[*]
- name: stg_gie_region_flat
path: /api
primary_keys:
- code
- gasDayStart
records_path: $.data[*]
select:
- '*.*'
- name: stg_gie_faclist
inherit_from: tap-rest-api-msdk
config:
api_url: https://agsi.gie.eu
headers:
x-key: $ENV_GIE_XKEY
streams:
- name: stg_gie_faclist
path: /api/about
- name: stg_gie_faclist_2
path: /api/about?show=listing
- name: stg_usgs
inherit_from: tap-rest-api-msdk
config:
api_url: https://earthquake.usgs.gov/fdsnws
streams:
- name: stg_usgs_earthquakes
params:
format: geojson
starttime: '2010-01-01'
# endtime: '2014-01-02'
minmagnitude: 6
path: /event/1/query
primary_keys:
- id
records_path: $.features[*]
num_inference_records: 200
select:
- '*.*'
loaders:
- name: target-duckdb
pip_url: target-duckdb~=0.4
config:
add_metadata_columns: true
default_target_schema: main
filepath: $DB_LOCATION
data_flattening_max_level: 10
- name: target-duckdb-usgs
inherit_from: target-duckdb
config:
add_metadata_columns: true
default_target_schema: main
filepath: $DB_LOCATION
data_flattening_max_level: 10
primary_key_required: false
- name: target-duckdb-try
inherit_from: target-duckdb
config:
add_metadata_columns: true
default_target_schema: main
filepath: $DB_LOCATION
data_flattening_max_level: 10
primary_key_required: false
orchestrators:
- name: airflow
variant: apache
pip_url: apache-airflow==2.1.2 --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.1.2/constraints-${MELTANO__PYTHON_VERSION}.txt
files:
- name: files-airflow
variant: meltano
pip_url: git+https://github.com/meltano/files-airflow.git --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.1.2/constraints-${MELTANO__PYTHON_VERSION}.txt
utilities:
- name: superset
variant: apache
pip_url: apache-superset==2.0.0 flask==2.0.3 werkzeug==2.0.3 jinja2==3.0.1 wtforms==2.3.3
cryptography==3.4.7
markupsafe==2.0.1
duckdb-engine==0.7.0
# git+https://github.com/meltano/superset-ext.git@main
- name: dbt-duckdb
variant: jwills
pip_url: dbt-core~=1.4.0 dbt-duckdb~=1.4.0
git+https://github.com/meltano/dbt-ext.git@main
commands:
usgs:
args: run --select tag:usgs
description: Runs dbt USGS (earthquake data) jobs instead of all dbt jobs.
gie:
args: run --select tag:gie
description: Runs dbt GIE (gas inventory data) jobs instead of all dbt jobs.
- name: great_expectations
variant: great-expectations
pip_url: great_expectations[sqlalchemy]
duckdb-engine==0.7.0
# sqlalchemy==1.4.47
- name: elementary
variant: elementary
pip_url: elementary-data[sqlalchemy]==0.8.0 git+https://github.com/potloc/elementary-ext.git
duckdb-engine==0.7.0
#commands:
# dbt run --select elementary
jobs:
- name: usgs-to-duckdb-rpt
tasks:
- stg_usgs target-duckdb-usgs dbt-duckdb:usgs
schedules:
- name: USGS-Earthquake
interval: 35 */1 * * *
job: usgs-to-duckdb-rpt
start_date: 2023-01-01 15:40:21.295936