Skip to content

Commit

Permalink
feat: support for nullable columns
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Jul 5, 2023
1 parent 30f7c75 commit 6f78e3a
Show file tree
Hide file tree
Showing 38 changed files with 413 additions and 102 deletions.
8 changes: 6 additions & 2 deletions endToEndTests/test/queries/GroupByDivision.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
}
},
"expectedQueryResult": [
{
"count": 2,
"division": null
},
{
"count": 6,
"division": "Aargau"
Expand All @@ -24,7 +28,7 @@
"division": "Basel-Stadt"
},
{
"count": 10,
"count": 9,
"division": "Bern"
},
{
Expand Down Expand Up @@ -56,7 +60,7 @@
"division": "Schwyz"
},
{
"count": 16,
"count": 15,
"division": "Solothurn"
},
{
Expand Down
8 changes: 4 additions & 4 deletions endToEndTests/test/queries/GroupByLineage.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
}
},
"expectedQueryResult": [
{
"count": 1,
"pango_lineage": null
},
{
"count": 3,
"pango_lineage": "B.1"
Expand Down Expand Up @@ -95,10 +99,6 @@
"count": 1,
"pango_lineage": "B.1.617.2.122"
},
{
"count": 1,
"pango_lineage": "B.1.617.2.42"
},
{
"count": 4,
"pango_lineage": "B.1.617.2.43"
Expand Down
71 changes: 71 additions & 0 deletions endToEndTests/test/queries/OrderByAge.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"testCaseName": "Order By age column ascending",
"query": {
"action": {
"type": "Aggregated",
"groupByFields": ["age"],
"orderByFields": ["age asc"]
},
"filterExpression": {
"type": "True"
}
},
"expectedQueryResult": [
{
"age": null,
"count": 2
},
{
"age": 4,
"count": 2
},
{
"age": 5,
"count": 1
},
{
"age": 6,
"count": 1
},
{
"age": 50,
"count": 17
},
{
"age": 51,
"count": 7
},
{
"age": 52,
"count": 8
},
{
"age": 53,
"count": 8
},
{
"age": 54,
"count": 9
},
{
"age": 55,
"count": 8
},
{
"age": 56,
"count": 9
},
{
"age": 57,
"count": 10
},
{
"age": 58,
"count": 9
},
{
"age": 59,
"count": 9
}
]
}
28 changes: 16 additions & 12 deletions endToEndTests/test/queries/OrderByFloat.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,59 @@
{
"testCaseName": "Order By QC float column",
"testCaseName": "Order By QC float column ascending",
"query": {
"action": {
"type": "Aggregated",
"groupByFields": ["qc_value"],
"orderByFields": ["qc_value desc"]
"orderByFields": ["qc_value asc"]
},
"filterExpression": {
"type": "True"
}
},
"expectedQueryResult": [
{
"count": 10,
"qc_value": 0.98
"count": 2,
"qc_value": null
},
{
"count": 10,
"qc_value": 0.97
"qc_value": 0.89
},
{
"count": 10,
"qc_value": 0.96
"qc_value": 0.9
},
{
"count": 10,
"qc_value": 0.95
"qc_value": 0.91
},
{
"count": 10,
"qc_value": 0.94
"qc_value": 0.92
},
{
"count": 10,
"qc_value": 0.93
},
{
"count": 10,
"qc_value": 0.92
"qc_value": 0.94
},
{
"count": 8,
"qc_value": 0.95
},
{
"count": 10,
"qc_value": 0.91
"qc_value": 0.96
},
{
"count": 10,
"qc_value": 0.9
"qc_value": 0.97
},
{
"count": 10,
"qc_value": 0.89
"qc_value": 0.98
}
]
}
59 changes: 59 additions & 0 deletions endToEndTests/test/queries/OrderByFloatDesc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"testCaseName": "Order By QC float column descending",
"query": {
"action": {
"type": "Aggregated",
"groupByFields": ["qc_value"],
"orderByFields": ["qc_value desc"]
},
"filterExpression": {
"type": "True"
}
},
"expectedQueryResult": [
{
"count": 10,
"qc_value": 0.98
},
{
"count": 10,
"qc_value": 0.97
},
{
"count": 10,
"qc_value": 0.96
},
{
"count": 8,
"qc_value": 0.95
},
{
"count": 10,
"qc_value": 0.94
},
{
"count": 10,
"qc_value": 0.93
},
{
"count": 10,
"qc_value": 0.92
},
{
"count": 10,
"qc_value": 0.91
},
{
"count": 10,
"qc_value": 0.9
},
{
"count": 10,
"qc_value": 0.89
},
{
"count": 2,
"qc_value": null
}
]
}
58 changes: 58 additions & 0 deletions endToEndTests/test/queries/OrderByFloatFiltered.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"testCaseName": "Order By QC float column ascending after filtering",
"query": {
"action": {
"type": "Aggregated",
"groupByFields": ["qc_value"],
"orderByFields": ["qc_value asc"]
},
"filterExpression": {
"from": 0.1,
"to": 2121.1,
"column": "qc_value",
"type": "FloatBetween"
}
},
"expectedQueryResult": [
{
"count": 10,
"qc_value": 0.89
},
{
"count": 10,
"qc_value": 0.9
},
{
"count": 10,
"qc_value": 0.91
},
{
"count": 10,
"qc_value": 0.92
},
{
"count": 10,
"qc_value": 0.93
},
{
"count": 10,
"qc_value": 0.94
},
{
"count": 8,
"qc_value": 0.95
},
{
"count": 10,
"qc_value": 0.96
},
{
"count": 10,
"qc_value": 0.97
},
{
"count": 10,
"qc_value": 0.98
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 59
"count": 58
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/dateBetween_noBounds.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 100
"count": 99
}
]
}
19 changes: 19 additions & 0 deletions endToEndTests/test/queries/dateBetween_null_excluded.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"testCaseName": "DateBetween Query from an early date with unbounded 'to'",
"query": {
"action": {
"type": "Aggregated"
},
"filterExpression": {
"type": "DateBetween",
"column": "date",
"from": "2012-03-18",
"to": null
}
},
"expectedQueryResult": [
{
"count": 99
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/dateBetween_openFrom1.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 52
"count": 51
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/dateBetween_openFrom2.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 53
"count": 52
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/dateBetween_openFrom3.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 54
"count": 53
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/floatBetween_openTo.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 80
"count": 78
}
]
}
2 changes: 1 addition & 1 deletion endToEndTests/test/queries/intBetween.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"expectedQueryResult": [
{
"count": 25
"count": 33
}
]
}
Loading

0 comments on commit 6f78e3a

Please sign in to comment.