-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d46767e
commit 3eff113
Showing
7 changed files
with
210 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
{"id": 1, "name": "UK", "area_km2": 244376, "cities": [{"name": "London"}, {"name": "Birmingham"}, {"name": "Manchester"}, {"name": "Glasgow"}, {"name": "Liverpool"}, {"name": "Bristol"}, {"name": "Edinburgh"}, {"name": "Leeds"}, {"name": "Sheffield"}, {"name": "Newcastle"}, {"name": "Nottingham"}, {"name": "Cardiff"}, {"name": "Belfast"}, {"name": "Leicester"}, {"name": "Coventry"}, {"name": "Sunderland"}, {"name": "Brighton"}, {"name": "Hull"}, {"name": "Plymouth"}, {"name": "Derby"}]} | ||
{"id": 2, "name": "Sweden", "area_km2": 450295, "cities": [{"name": "Stockholm"}, {"name": "Gothenburg"}, {"name": "Malmö"}, {"name": "Uppsala"}, {"name": "Västerås"}, {"name": "Örebro"}, {"name": "Linköping"}, {"name": "Helsingborg"}]} | ||
{"id": 3, "name": "Australia", "area_km2": 7688287, "cities": [{"name": "Melbourne"}, {"name": "Sydney"}, {"name": "Brisbane"}, {"name": "Adelaide"}, {"name": "Canberra"}, {"name": "Perth"}, {"name": "Darwin"}, {"name": "Hobart"}]} | ||
{"id": 4, "name": "Mars", "area_km2": 144798500, "cities": []} |
16 changes: 16 additions & 0 deletions
16
ndc-reference/tests/query/predicate_with_array_contains/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
[ | ||
{ | ||
"rows": [ | ||
{ | ||
"id": 2, | ||
"name": "Chalmers University of Technology", | ||
"location": { | ||
"campuses": [ | ||
"Johanneberg", | ||
"Lindholmen" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] |
52 changes: 52 additions & 0 deletions
52
ndc-reference/tests/query/predicate_with_array_contains/request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"$schema": "../../../../ndc-models/tests/json_schema/query_request.jsonschema", | ||
"collection": "institutions", | ||
"arguments": {}, | ||
"query": { | ||
"fields": { | ||
"id": { | ||
"type": "column", | ||
"column": "id" | ||
}, | ||
"name": { | ||
"type": "column", | ||
"column": "name" | ||
}, | ||
"location": { | ||
"type": "column", | ||
"column": "location", | ||
"fields": { | ||
"type": "object", | ||
"fields": { | ||
"campuses": { | ||
"type": "column", | ||
"column": "campuses", | ||
"arguments": { | ||
"limit": { | ||
"type": "literal", | ||
"value": null | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"predicate": { | ||
"type": "array_comparison", | ||
"column": { | ||
"type": "column", | ||
"name": "location", | ||
"field_path": ["campuses"] | ||
}, | ||
"comparison": { | ||
"type": "contains", | ||
"value": { | ||
"type": "scalar", | ||
"value": "Lindholmen" | ||
} | ||
} | ||
} | ||
}, | ||
"collection_relationships": {} | ||
} |
11 changes: 11 additions & 0 deletions
11
ndc-reference/tests/query/predicate_with_array_is_empty/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[ | ||
{ | ||
"rows": [ | ||
{ | ||
"id": 4, | ||
"name": "Mars", | ||
"cities": [] | ||
} | ||
] | ||
} | ||
] |
44 changes: 44 additions & 0 deletions
44
ndc-reference/tests/query/predicate_with_array_is_empty/request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"$schema": "../../../../ndc-models/tests/json_schema/query_request.jsonschema", | ||
"collection": "countries", | ||
"arguments": {}, | ||
"query": { | ||
"fields": { | ||
"id": { | ||
"type": "column", | ||
"column": "id" | ||
}, | ||
"name": { | ||
"type": "column", | ||
"column": "name" | ||
}, | ||
"cities": { | ||
"type": "column", | ||
"column": "cities", | ||
"arguments": { | ||
"limit": { | ||
"type": "literal", | ||
"value": null | ||
} | ||
} | ||
} | ||
}, | ||
"predicate": { | ||
"type": "array_comparison", | ||
"column": { | ||
"type": "column", | ||
"name": "cities", | ||
"arguments": { | ||
"limit": { | ||
"type": "literal", | ||
"value": null | ||
} | ||
} | ||
}, | ||
"comparison": { | ||
"type": "is_empty" | ||
} | ||
} | ||
}, | ||
"collection_relationships": {} | ||
} |
28 changes: 28 additions & 0 deletions
28
ndc-reference/tests/query/predicate_with_exists_in_nested_scalar_collection/expected.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[ | ||
{ | ||
"rows": [ | ||
{ | ||
"id": 1, | ||
"name": "Queen Mary University of London", | ||
"location": { | ||
"campuses": [ | ||
"Mile End", | ||
"Whitechapel", | ||
"Charterhouse Square", | ||
"West Smithfield" | ||
] | ||
} | ||
}, | ||
{ | ||
"id": 2, | ||
"name": "Chalmers University of Technology", | ||
"location": { | ||
"campuses": [ | ||
"Johanneberg", | ||
"Lindholmen" | ||
] | ||
} | ||
} | ||
] | ||
} | ||
] |
58 changes: 58 additions & 0 deletions
58
ndc-reference/tests/query/predicate_with_exists_in_nested_scalar_collection/request.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
{ | ||
"$schema": "../../../../ndc-models/tests/json_schema/query_request.jsonschema", | ||
"collection": "institutions", | ||
"arguments": {}, | ||
"query": { | ||
"fields": { | ||
"id": { | ||
"type": "column", | ||
"column": "id" | ||
}, | ||
"name": { | ||
"type": "column", | ||
"column": "name" | ||
}, | ||
"location": { | ||
"type": "column", | ||
"column": "location", | ||
"fields": { | ||
"type": "object", | ||
"fields": { | ||
"campuses": { | ||
"type": "column", | ||
"column": "campuses", | ||
"arguments": { | ||
"limit": { | ||
"type": "literal", | ||
"value": null | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"predicate": { | ||
"type": "exists", | ||
"in_collection": { | ||
"type": "nested_scalar_collection", | ||
"column_name": "location", | ||
"field_path": ["campuses"], | ||
"arguments": {} | ||
}, | ||
"predicate": { | ||
"type": "binary_comparison_operator", | ||
"column": { | ||
"type": "column", | ||
"name": "__value" | ||
}, | ||
"operator": "like", | ||
"value": { | ||
"type": "scalar", | ||
"value": "d" | ||
} | ||
} | ||
} | ||
}, | ||
"collection_relationships": {} | ||
} |