-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinput_example.sh
More file actions
177 lines (137 loc) · 4.41 KB
/
input_example.sh
File metadata and controls
177 lines (137 loc) · 4.41 KB
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
# Load Data from Local / Random API to Different Target
# MongoDB Example
# Require Manual creating database on MongoDB Atlas via WebUI
# Initiate MongoDB Database and Collections
python tools/db_init/mongo_init.py --database kde-db --prefix kde
# Clean Colelctions
# python tools/db_init/mongo_init.py --database kde-db --reset
# Load with Local Data (data_path)
python ./tools/data_init/loader_main.py \
--load-type batch \
--destination mongodb \
--database kde-db \
--collection kde-finance-cards-data \
--data-path data/json/cards_data.json \
--rows 10
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination mongodb \
--database kde-db \
--collection kde-finance-cards-data \
--data-path data/json/cards_data.json \
--rows 20 \
--streaming-interval 0.5
# Load Data from random_api
python ./tools/data_init/loader_main.py \
--load-type batch \
--destination mongodb \
--database kde-db \
--collection kde-finance-random-user \
--random-api \
--rows 20
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination mongodb \
--database kde-db \
--collection kde-finance-random-user \
--random-api \
--rows 10 \
--streaming-interval 0.5
# Firestore Example
# Require Terraform to create Database on GCP first
# Firestore don't require to initiate Collections
# Clean Collections
python tools/db_init/firestore_init.py --database '(default)' --reset
# python tools/db_init/firestore_init.py --database '(default)' --prefix kde --reset
# Load with Local Data (data_path)
python ./tools/data_init/loader_main.py \
--load-type batch \
--destination firestore \
--project-name ${GCP__PROJECT} \
--database '(default)' \
--collection kde-finance-cards-data \
--data-path data/json/cards_data.json \
--rows 20
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination firestore \
--project-name ${GCP__PROJECT} \
--database '(default)' \
--collection kde-finance-cards-data \
--data-path data/json/cards_data.json \
--rows 10 \
--streaming-interval 0.5
# Load Data from random_api
python ./tools/data_init/loader_main.py \
--load-type batch \
--destination firestore \
--project-name ${GCP__PROJECT} \
--database '(default)' \
--collection kde-finance-random-user \
--random-api \
--rows 20
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination firestore \
--project-name ${GCP__PROJECT} \
--database '(default)' \
--collection kde-finance-random-user \
--random-api \
--rows 10 \
--streaming-interval 0.5
# DynamoDB Example
# Require Terraform to create DynamoDB resources on AWS first
# Resetting can be done by destroying DynamoDB resources via Terraform
# Load with Local Data (data_path)
python ./tools/data_init/loader_main.py \
--load-type batch \
--destination dynamodb \
--profile kde-local-sso-cli \
--table cards-data \
--data-path data/json/cards_data.json \
--rows 5
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination dynamodb \
--profile kde-local-sso-cli \
--table cards-data \
--data-path data/json/cards_data.json \
--rows 10 \
--streaming-interval 0.5
# Load Data from random_api
# python ./tools/data_init/loader_main.py \
# --load-type batch \
# --destination dynamodb \
# --profile kde-local-sso-cli \
# --table cards-data \
# --random-api \
# --rows 15
# python ./tools/data_init/loader_main.py \
# --load-type streaming \
# --destination dynamodb \
# --profile kde-local-sso-cli \
# --table cards-data \
# --random-api \
# --rows 20 \
# --streaming-interval 0.5
# Kafka Example
# Require to start Kafka containers
# Resetting can be done by deleting Kafka Containers
# Load with Local Data (data_path)
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination kafka \
--bootstrap-server localhost:9092 \
--topic cards-data \
--data-path data/json/cards_data.json \
--rows 10 \
--streaming-interval 0.5
# Load Data from random_api
python ./tools/data_init/loader_main.py \
--load-type streaming \
--destination kafka \
--bootstrap-server localhost:9092 \
--topic random-api \
--random-api \
--rows 10 \
--streaming-interval 0.5