forked from The-APIS/apis-etl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.yaml
112 lines (97 loc) · 2.78 KB
/
project.yaml
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
parameters:
user_prefix: ""
schema:
logs: analytics_logs
staging: analytics_staging
models: analytics_models
viz: analytics_viz
is_test: false
test_values:
start_block: -1
end_block: -1
blockchain:
bsc: 'https://bsc-dataseed.binance.org'
eth: 'https://mainnet.ethereum.nodes-mainnet.theapis.io'
from_prod:
required_credentials:
- warehouse
# - postgres_ethereum
# - bigquery
# - postgres
default_db: warehouse
presets:
# Source Table and ddl required
# extract_postgres:
# type: copy
# source:
# db: postgres_ethereum
# schema: public
# destination:
# schema: "{{ schema['logs'] }}"
# table: "{{ user_prefix }}{{ task.name['extract_'|length:] }}"
# incremental_key: id
# delete_key: id
# max_merge_rows: 1000000
# Source Table and ddl required
# extract_bigquery:
# type: copy
# source:
# db: bigquery
# schema: bigquery-public-data.crypto_ethereum
# destination:
# schema: "{{ schema['logs'] }}"
# table: "{{ user_prefix }}{{ task.name['extract_'|length:] }}"
# incremental_key: block_timestamp
# delete_key: address
# max_merge_rows: 1000000
# Source Table and ddl required
extract_snowflake:
type: copy
source:
db: warehouse
schema: analytics_models
table: f_ethereum_blocks
destination:
db: postgres_ethereum
schema: public
table: "{{ user_prefix }}{{ task.name['extract_'|length:] }}"
incremental_key: timestamp
delete_key: hash
max_merge_rows: 1000000
staging:
type: autosql
materialisation: table
file_name: "{{ task.group }}/{{ task.name }}.sql"
destination:
tmp_schema: "{{ schema['staging'] }}"
schema: "{{ schema['staging'] }}"
table: "{{ user_prefix }}{{ task.name }}"
models:
type: autosql
materialisation: table
file_name: "{{ task.group }}/{{ task.name }}.sql"
destination:
tmp_schema: "{{ schema['staging'] }}"
schema: "{{ schema['models'] }}"
table: "{{ user_prefix }}{{ task.name }}"
metabase:
type: autosql
file_name: "{{ task.group }}/{{ task.name }}.sql"
materialisation: view
destination:
schema: "{{ schema['viz'] }}"
table: "{{ user_prefix }}{{ task.name[3:] }}"
create_table:
type: sql
file_name: "create_tables/{{ task.name.split('_')[0] }}_{{ task.name.split('_')[-1] }}.sql"
parameters:
schema: "{{ schema['logs'] }}"
table: "{{ user_prefix }}{{ task.name['create_'|length:] }}"
copy_from_stage:
type: sql
file_name: "extract/copy_from_stage.sql"
parameters:
stage: "{{ task.name.split('_')[1] }}_stage"
schema: "{{ schema['logs'] }}"
currency: "{{ task.name.split('_')[1] }}"
table: "{{ task.name.split('_')[-1] }}"