Skip to content
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

fix: remove matviewgraph column from pg_matviews #16246

Merged
merged 2 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions e2e_test/ddl/show.slt
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ describe pg_matviews;
schemaname character varying false NULL
matviewname character varying false NULL
matviewowner integer false NULL
tablespace character varying false NULL
hasindexes boolean false NULL
ispopulated boolean false NULL
definition character varying false NULL
matviewid integer false NULL
matviewtimezone character varying false NULL
matviewgraph character varying false NULL
table description pg_matviews NULL NULL

query TTTT
Expand All @@ -211,7 +211,7 @@ show columns from pg_catalog.pg_matviews;
schemaname character varying false NULL
matviewname character varying false NULL
matviewowner integer false NULL
tablespace character varying false NULL
hasindexes boolean false NULL
ispopulated boolean false NULL
definition character varying false NULL
matviewid integer false NULL
matviewtimezone character varying false NULL
matviewgraph character varying false NULL
30 changes: 13 additions & 17 deletions src/frontend/src/catalog/system_catalog/pg_catalog/pg_matviews.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,24 @@ use risingwave_frontend_macro::system_catalog;
#[system_catalog(
view,
"pg_catalog.pg_matviews",
"SELECT schemaname,
i.relationname AS matviewname,
i.relationowner AS matviewowner,
definition,
i.relationid AS matviewid,
i.relationtimezone AS matviewtimezone,
i.fragments AS matviewgraph
FROM rw_catalog.rw_relation_info i
WHERE i.relationtype = 'MATERIALIZED VIEW'"
"SELECT
s.name as schemaname,
mv.name as matviewname,
mv.owner as matviewowner,
NULL AS tablespace,
false AS hasindexes,
true AS ispopulated,
mv.definition as definition
FROM rw_materialized_views mv
JOIN rw_schemas s ON mv.schema_id = s.id"
)]
#[derive(Fields)]
struct PgMatview {
schemaname: String,
matviewname: String,
matviewowner: i32,
tablespace: Option<String>,
hasindexes: bool,
ispopulated: bool,
definition: String,
// Below are some columns that PostgreSQL doesn't have.
// TODO: these field is only exist in RW and used by cloud side, need to remove it and let
// cloud switch to use `rw_catalog.rw_relation_info`.
matviewid: i32,
// The timezone used to interpret ambiguous dates/timestamps as tstz
matviewtimezone: String,
// materialized view graph is json encoded fragment infos.
matviewgraph: String,
}
Loading