Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit fa2052e

Browse files
committed
Update schema to include field validations
1 parent e8aa318 commit fa2052e

4 files changed

Lines changed: 613 additions & 172 deletions

File tree

docker/data/custom/validation/all/all-validation.yaml

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dataSources:
99
pauseInSeconds: 1
1010
validations:
1111
- expr: "amount < 100"
12+
description: "Amount should be less than 100"
1213
- expr: "year == 2021"
1314
errorThreshold: 0.1
1415
- expr: "regexp_like(name, 'Peter .*')"
@@ -18,64 +19,68 @@ dataSources:
1819
- groupByFields: ["account_id"]
1920
aggType: "count"
2021
aggExpr: "count == 1"
21-
- fieldNameType: "columnCountEqual"
22-
count: "3"
23-
- fieldNameType: "columnCountBetween"
24-
minCount: "1"
25-
maxCount: "2"
26-
- fieldNameType: "columnNameMatchOrder"
22+
errorThreshold: 10
23+
- groupByFields: ["account_id"]
24+
aggExpr: "count == 1"
25+
aggType: count
26+
- fieldNameType: "fieldCountEqual"
27+
count: 3
28+
errorThreshold: 0.1
29+
- fieldNameType: "fieldCountBetween"
30+
minCount: 1
31+
maxCount: 2
32+
- fieldNameType: "fieldNameMatchOrder"
2733
names: ["account_id", "amount", "name"]
28-
- fieldNameType: "columnNameMatchSet"
34+
- fieldNameType: "fieldNameMatchSet"
2935
names: ["account_id", "my_name"]
3036
- upstreamDataSource: "my_first_json"
3137
upstreamReadOptions: {}
3238
joinFields: ["account_id"]
3339
joinType: "outer"
34-
validation:
35-
expr: "my_first_json_customer_details.name == name"
40+
validations:
41+
- expr: "my_first_json_customer_details.name == name"
3642
- upstreamDataSource: "my_first_json"
3743
upstreamReadOptions: {}
3844
joinFields: ["account_id"]
3945
joinType: "outer"
40-
validation:
41-
expr: "amount != my_first_json_balance"
46+
validations:
47+
- expr: "amount != my_first_json_balance"
4248
- upstreamDataSource: "my_first_json"
43-
upstreamReadOptions: {}
4449
joinFields: ["expr:account_id == my_first_json_account_id"]
4550
joinType: "outer"
46-
validation:
47-
groupByCols: ["account_id", "my_first_json_balance"]
48-
aggExpr: "sum(amount) BETWEEN my_first_json_balance * 0.8 AND my_first_json_balance * 1.2"
51+
validations:
52+
- groupByFields: ["account_id", "my_first_json_balance"]
53+
aggExpr: "sum(amount) BETWEEN my_first_json_balance * 0.8 AND my_first_json_balance * 1.2"
54+
aggType: sum
4955
- upstreamDataSource: "my_first_json"
50-
upstreamReadOptions: {}
5156
joinFields: ["account_id"]
5257
joinType: "outer"
53-
validation:
54-
groupByCols: ["account_id", "my_first_json_balance"]
55-
aggExpr: "sum(amount) BETWEEN my_first_json_balance * 0.8 AND my_first_json_balance * 1.2"
58+
validations:
59+
- groupByFields: ["account_id", "my_first_json_balance"]
60+
aggExpr: "sum(amount) BETWEEN my_first_json_balance * 0.8 AND my_first_json_balance * 1.2"
61+
aggType: sum
5662
- upstreamDataSource: "my_first_json"
5763
upstreamReadOptions: {}
5864
joinFields: ["account_id"]
5965
joinType: "anti"
60-
validation:
61-
aggType: "count"
62-
aggExpr: "count == 0"
66+
validations:
67+
- aggType: "count"
68+
aggExpr: "count == 0"
6369
- upstreamDataSource: "my_first_json"
6470
upstreamReadOptions: {}
6571
joinFields: ["account_id"]
6672
joinType: "outer"
67-
validation:
68-
aggType: "count"
69-
aggExpr: "count == 30"
73+
validations:
74+
- aggType: "count"
75+
aggExpr: "count == 30"
7076
- upstreamDataSource: "my_first_json"
7177
upstreamReadOptions: {}
7278
joinFields: ["account_id"]
7379
joinType: "outer"
74-
validation:
75-
upstreamDataSource: "my_third_json"
76-
upstreamReadOptions: {}
77-
joinFields: ["account_id"]
78-
joinType: "outer"
79-
validation:
80-
aggType: "count"
81-
aggExpr: "count == 30"
80+
validations:
81+
- upstreamDataSource: "my_third_json"
82+
joinFields: ["account_id"]
83+
joinType: "outer"
84+
validations:
85+
- aggType: "count"
86+
aggExpr: "count == 30"

docker/data/custom/validation/json/json-validation.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ dataSources:
3838
- type: "hasType"
3939
value: "string"
4040
negate: true
41-
- type: "hasType"
41+
- type: "hasTypes"
4242
values: [ "string", "double" ]
4343
negate: true
4444
- type: "distinctInSet"
@@ -70,13 +70,13 @@ dataSources:
7070
- field: links
7171
validation:
7272
- type: "size"
73-
value: 5
73+
size: 5
7474
negate: true
7575
- type: "lessThanSize"
76-
value: 5
76+
size: 5
7777
strictly: false
7878
- type: "greaterThanSize"
79-
value: 5
79+
size: 5
8080
strictly: false
8181
- field: amount
8282
validation:
@@ -128,6 +128,6 @@ dataSources:
128128
- type: "quantileValuesBetween"
129129
quantileRanges:
130130
"0.1":
131-
- 1.0
132-
- 10.0
131+
- - 1.0
132+
- 10.0
133133
negate: true

docker/data/custom/validation/simple-validation.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ dataSources:
77
path: "app/src/test/resources/sample/json/txn-gen"
88
validations:
99
- expr: "amount < 100"
10+
- field: name
11+
validation:
12+
- type: "null"
13+
negate: false
1014
- field: amount
1115
validation:
1216
- type: "null"

0 commit comments

Comments
 (0)