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

[Feature] Support show create MATERIALIZED VIEW sql #9196

Closed
2 of 3 tasks
dataalive opened this issue Apr 24, 2022 · 2 comments
Closed
2 of 3 tasks

[Feature] Support show create MATERIALIZED VIEW sql #9196

dataalive opened this issue Apr 24, 2022 · 2 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dataalive
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Description

after we create materialized view , we can only use desc table_name all to show all the materialized view which have been created.

MySQL [test]> create table sales_records(record_id int, seller_id int, store_id int, sale_date date, sale_amt bigint) distributed by hash(record_id) properties("replication_num" = "1");
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> create materialized view store_amt as select store_id, sum(sale_amt) from sales_records group by store_id; 
Query OK, 0 rows affected (0.00 sec)

MySQL [test]> desc  sales_records all;
+---------------+---------------+-----------+--------+------+-------+---------+-------+---------+
| IndexName     | IndexKeysType | Field     | Type   | Null | Key   | Default | Extra | Visible |
+---------------+---------------+-----------+--------+------+-------+---------+-------+---------+
| sales_records | DUP_KEYS      | record_id | INT    | Yes  | true  | NULL    |       | true    |
|               |               | seller_id | INT    | Yes  | true  | NULL    |       | true    |
|               |               | store_id  | INT    | Yes  | true  | NULL    |       | true    |
|               |               | sale_date | DATE   | Yes  | false | NULL    | NONE  | true    |
|               |               | sale_amt  | BIGINT | Yes  | false | NULL    | NONE  | true    |
|               |               |           |        |      |       |         |       |         |
| store_amt     | AGG_KEYS      | store_id  | INT    | Yes  | true  | NULL    |       | true    |
|               |               | sale_amt  | BIGINT | Yes  | false | NULL    | SUM   | true    |
+---------------+---------------+-----------+--------+------+-------+---------+-------+---------+
8 rows in set (0.00 sec)

but sometimes we need to know the create materialized view sql like show create table table_name shows.

so the new feature should react like

show create materialized view store_amt;

and the result is the complete sql.

Use case

No response

Related issues

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@dataalive dataalive added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 24, 2022
@stalary
Copy link
Contributor

stalary commented Apr 26, 2022

Are you working on it? If not, assign it to me

@dataalive
Copy link
Contributor Author

OK, Great . I'm not working on this, @morningman pls assign to @stalary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

3 participants