-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from hasura:fix-variables-again
Fix-variables-again
- Loading branch information
Showing
12 changed files
with
121 additions
and
40 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -6,5 +6,5 @@ members = [ | |
] | ||
resolver = "2" | ||
|
||
package.version = "1.0.0" | ||
package.version = "1.0.1" | ||
package.edition = "2021" |
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
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
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
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 |
---|---|---|
|
@@ -4,6 +4,9 @@ | |
"variables": [ | ||
{ | ||
"ArtistId": 1 | ||
}, | ||
{ | ||
"ArtistId": 2 | ||
} | ||
], | ||
"query": { | ||
|
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
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
53 changes: 53 additions & 0 deletions
53
crates/ndc-clickhouse/tests/query_builder/chinook/03_variables/03_single_set.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,53 @@ | ||
{ | ||
"$schema": "../../request.schema.json", | ||
"collection": "Chinook_Album", | ||
"variables": [ | ||
{ | ||
"ArtistId": 1 | ||
} | ||
], | ||
"query": { | ||
"fields": { | ||
"albumId": { | ||
"type": "column", | ||
"column": "AlbumId", | ||
"fields": null | ||
}, | ||
"artistId": { | ||
"type": "column", | ||
"column": "ArtistId", | ||
"fields": null | ||
}, | ||
"title": { | ||
"type": "column", | ||
"column": "Title", | ||
"fields": null | ||
} | ||
}, | ||
"predicate": { | ||
"type": "and", | ||
"expressions": [ | ||
{ | ||
"type": "and", | ||
"expressions": [ | ||
{ | ||
"type": "binary_comparison_operator", | ||
"column": { | ||
"type": "column", | ||
"name": "ArtistId", | ||
"path": [] | ||
}, | ||
"operator": "_eq", | ||
"value": { | ||
"type": "variable", | ||
"name": "ArtistId" | ||
} | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"arguments": {}, | ||
"collection_relationships": {} | ||
} |
48 changes: 48 additions & 0 deletions
48
crates/ndc-clickhouse/tests/query_builder/chinook/03_variables/03_single_set.statement.sql
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,48 @@ | ||
WITH "_vars" AS ( | ||
SELECT | ||
* | ||
FROM | ||
format( | ||
JSONColumns, | ||
'{"_varset_id":[1],"_var_ArtistId":[1]}' | ||
) | ||
) | ||
SELECT | ||
toJSONString( | ||
groupArray( | ||
cast( | ||
"_rowset"."_rowset", | ||
'Tuple(rows Array(Tuple("albumId" Int32, "artistId" Int32, "title" String)))' | ||
) | ||
) | ||
) AS "rowsets" | ||
FROM | ||
"_vars" AS "_vars" | ||
LEFT JOIN ( | ||
SELECT | ||
tuple( | ||
groupArray( | ||
tuple( | ||
"_row"."_field_albumId", | ||
"_row"."_field_artistId", | ||
"_row"."_field_title" | ||
) | ||
) | ||
) AS "_rowset", | ||
"_row"."_varset_id" AS "_varset_id" | ||
FROM | ||
( | ||
SELECT | ||
"_origin"."AlbumId" AS "_field_albumId", | ||
"_origin"."ArtistId" AS "_field_artistId", | ||
"_origin"."Title" AS "_field_title", | ||
"_vars"."_varset_id" AS "_varset_id" | ||
FROM | ||
"_vars" AS "_vars" | ||
CROSS JOIN "Chinook"."Album" AS "_origin" | ||
WHERE | ||
"_origin"."ArtistId" = "_vars"."_var_ArtistId" | ||
) AS "_row" | ||
GROUP BY | ||
"_row"."_varset_id" | ||
) AS "_rowset" ON "_vars"."_varset_id" = "_rowset"."_varset_id" FORMAT TabSeparatedRaw; |
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,5 +1,6 @@ | ||
services: | ||
ndc-clickhouse: | ||
image: ndc-clickhouse-debug | ||
build: | ||
context: . | ||
args: | ||
|