forked from liuchenggang2014/workflow-bq-concurrent-dml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
insert2.workflows.yaml
52 lines (50 loc) · 1.55 KB
/
insert2.workflows.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
# long run insert with parameter
main:
params: [args]
steps:
- init:
assign:
- project_id: ${sys.get_env("GOOGLE_CLOUD_PROJECT_ID")}
- dataset_id: "ds201"
- table_id: "mobilelog2"
- prepareInsert:
switch:
- condition: ${args.key1 == 1}
next: insert1
- condition: ${args.key1 == 2}
next: insert2
- condition: ${args.key1 == 3}
next: insert3
- insert1:
call: googleapis.bigquery.v2.jobs.insert
args:
projectId: ${project_id}
body:
configuration:
query:
query: "INSERT INTO cliu201.ds201.mobilelog2 (id, price, product) VALUES ('1','1','1')"
allowLargeResults: true
useLegacySql: false
next: end
- insert2:
call: googleapis.bigquery.v2.jobs.insert
args:
projectId: ${project_id}
body:
configuration:
query:
query: "INSERT INTO cliu201.ds201.mobilelog2 (id, price, product) VALUES ('2','2','2')"
allowLargeResults: true
useLegacySql: false
next: end
- insert3:
call: googleapis.bigquery.v2.jobs.insert
args:
projectId: ${project_id}
body:
configuration:
query:
query: "INSERT INTO cliu201.ds201.mobilelog2 (id, price, product) VALUES ('3','3','3')"
allowLargeResults: true
useLegacySql: false
next: end