-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate-rows-to-sqlite.json
More file actions
58 lines (58 loc) · 1.89 KB
/
Copy pathvalidate-rows-to-sqlite.json
File metadata and controls
58 lines (58 loc) · 1.89 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
{
"$schema": "https://raw.githubusercontent.com/TheCocoTeam/source-watcher-api/master/pipeline.schema.json",
"notes": "Converts and validates sample order fields, annotating each row with any validation errors before loading to SQLite.",
"steps": [
{
"type": "extractor",
"name": "Csv",
"options": {
"filePath": "/var/www/html/.source-watcher/data/showcase-orders.csv"
},
"x": 40,
"y": 100
},
{
"type": "transformer",
"name": "TypeConversion",
"options": {
"fields": {
"id": "integer",
"price": "float",
"quantity": "integer",
"created_at": "date"
}
},
"x": 230,
"y": 100
},
{
"type": "transformer",
"name": "ValidateRows",
"options": {
"mode": "annotate",
"errorField": "_validation_errors",
"rules": {
"id": {"required": true, "type": "integer", "min": 1},
"email": {"required": true, "format": "email"},
"status": {"allowed": ["active", "inactive"]},
"price": {"required": true, "type": "float", "min": 0},
"quantity": {"required": true, "type": "integer", "min": 1}
}
},
"x": 440,
"y": 100
},
{
"type": "loader",
"name": "Database",
"options": {
"driver": "pdo_sqlite",
"tableName": "validated_orders",
"path": "/var/www/html/.source-watcher/validate-rows.db",
"memory": false
},
"x": 670,
"y": 100
}
]
}