-
Notifications
You must be signed in to change notification settings - Fork 2.8k
server: fix issue with tracking custom functions that return SETOF materialized view (close #5294)
#5945
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
server: fix issue with tracking custom functions that return SETOF materialized view (close #5294)
#5945
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cf7d1ae
make minor type changes
kolharsam adf1a89
add migrations and update catalog version
kolharsam b5024f2
update Changelog
kolharsam 1a1e108
Merge remote-tracking branch 'hq-origin/master' into server/track-mat…
kolharsam 37bc8f7
revert Changelog entry
69750c2
Merge branch 'master' into server/track-mat-views
2eea091
update setup tests
kolharsam b327a6e
update teardown
kolharsam 27442bb
update py file
kolharsam 8b8bbe5
add query search text
kolharsam 987c366
drop mat view in teardown
kolharsam 5fdbbdd
fix setup
kolharsam ea2214f
fix query test
kolharsam 92c0e4f
update teardown based on review
1294573
Merge branch 'master' into server/track-mat-views
8b4347b
update CHANGELOG
a32f4af
revert teardown change
6631bd9
Merge branch 'master' into server/track-mat-views
f796087
Merge branch 'master' into server/track-mat-views
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 +1 @@ | ||
| 39 | ||
| 40 |
This file contains hidden or 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 hidden or 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,46 @@ | ||
| CREATE | ||
| OR REPLACE VIEW hdb_catalog.hdb_function_info_agg AS ( | ||
| SELECT | ||
| function_name, | ||
| function_schema, | ||
| row_to_json ( | ||
| ( | ||
| SELECT | ||
| e | ||
| FROM | ||
| ( | ||
| SELECT | ||
| description, | ||
| has_variadic, | ||
| function_type, | ||
| return_type_schema, | ||
| return_type_name, | ||
| return_type_type, | ||
| returns_set, | ||
| input_arg_types, | ||
| input_arg_names, | ||
| default_args, | ||
| exists( | ||
| SELECT | ||
| 1 | ||
| FROM | ||
| information_schema.tables | ||
| WHERE | ||
| table_schema = return_type_schema | ||
| AND table_name = return_type_name | ||
| ) | ||
| OR exists( | ||
| SELECT | ||
| 1 | ||
| FROM | ||
| pg_matviews | ||
| WHERE | ||
| schemaname = return_type_schema | ||
| AND matviewname = return_type_name | ||
| ) AS returns_table | ||
| ) AS e | ||
| ) | ||
| ) AS "function_info" | ||
| FROM | ||
| hdb_catalog.hdb_function_agg | ||
| ); |
This file contains hidden or 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,37 @@ | ||
| CREATE | ||
| OR REPLACE VIEW hdb_catalog.hdb_function_info_agg AS ( | ||
| SELECT | ||
| function_name, | ||
| function_schema, | ||
| row_to_json ( | ||
| ( | ||
| SELECT | ||
| e | ||
| FROM | ||
| ( | ||
| SELECT | ||
| description, | ||
| has_variadic, | ||
| function_type, | ||
| return_type_schema, | ||
| return_type_name, | ||
| return_type_type, | ||
| returns_set, | ||
| input_arg_types, | ||
| input_arg_names, | ||
| default_args, | ||
| exists( | ||
| SELECT | ||
| 1 | ||
| FROM | ||
| information_schema.tables | ||
| WHERE | ||
| table_schema = return_type_schema | ||
| AND table_name = return_type_name | ||
| ) AS returns_table | ||
| ) AS e | ||
| ) | ||
| ) AS "function_info" | ||
| FROM | ||
| hdb_catalog.hdb_function_agg | ||
| ); |
18 changes: 18 additions & 0 deletions
18
server/tests-py/queries/graphql_query/functions/query_search_author_mview.yaml
This file contains hidden or 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,18 @@ | ||
| description: Custom GraphQL query using search_author_mview function which returns results from a materialized view | ||
| url: /v1/graphql | ||
| status: 200 | ||
| response: | ||
| data: | ||
| search_author_mview: | ||
| - first_name: franz | ||
| last_name: kafka | ||
| query: | ||
| query: | | ||
| query { | ||
| search_author_mview( | ||
| args: {query: "kafka"} | ||
| ) { | ||
| first_name | ||
| last_name | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.