-
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.
Throw an error when ordering by aggregation function over an empty path
- Loading branch information
Showing
5 changed files
with
70 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
28 changes: 28 additions & 0 deletions
28
...ry-engine/translation/tests/goldenfiles/sorting_by_no_relationship_aggregate/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,28 @@ | ||
{ | ||
"collection": "Album", | ||
"query": { | ||
"fields": { | ||
"Name": { | ||
"type": "column", | ||
"column": "Title", | ||
"arguments": {} | ||
} | ||
}, | ||
"order_by": { | ||
"elements": [ | ||
{ | ||
"target": { | ||
"type": "single_column_aggregate", | ||
"column": "TopRadioChartPlacement", | ||
"function": "impossible", | ||
"path": [ ] | ||
}, | ||
"order_direction": "desc" | ||
} | ||
] | ||
}, | ||
"limit": 3 | ||
}, | ||
"arguments": {}, | ||
"collection_relationships": {} | ||
} |
23 changes: 23 additions & 0 deletions
23
...ery-engine/translation/tests/goldenfiles/sorting_by_no_relationship_aggregate/tables.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,23 @@ | ||
{ | ||
"tables": { | ||
"Album": { | ||
"schemaName": "public", | ||
"tableName": "Album", | ||
"columns": { | ||
"AlbumId": { | ||
"name": "AlbumId", | ||
"type": "int4" | ||
}, | ||
"Title": { | ||
"name": "Title", | ||
"type": "varchar" | ||
}, | ||
"TopRadioChartPlacement": { | ||
"name": "TopRadioChartPlacement", | ||
"type": "int4", | ||
"nullable": "nullable" | ||
} | ||
} | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...query-engine/translation/tests/snapshots/tests__sorting_by_no_relationship_aggregate.snap
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,5 @@ | ||
--- | ||
source: crates/query-engine/translation/tests/tests.rs | ||
expression: "format!(\"{result:?}\")" | ||
--- | ||
Err(NotSupported("Cannot order by aggregation function 'impossible' on the same table")) |
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