This is an automated email from the ASF dual-hosted git repository. kassiez pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new 480494ff095 [mtmv]show create materialized view (#2156) 480494ff095 is described below commit 480494ff09596ed6cc1bfd3db75c09eab5f5cb30 Author: zhangdong <493738...@qq.com> AuthorDate: Wed Apr 23 20:31:53 2025 +0800 [mtmv]show create materialized view (#2156) ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 25 +++++++---------- .../SHOW-CREATE-MATERIALIZED-VIEW.md | 27 ++++++++---------- .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 27 +++++++++--------- .../SHOW-CREATE-MATERIALIZED-VIEW.md | 24 ++++++++-------- .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 30 ++++++++++---------- .../SHOW-CREATE-MATERIALIZED-VIEW.md | 29 ++++++++++---------- .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 30 ++++++++++---------- .../SHOW-CREATE-MATERIALIZED-VIEW.md | 30 ++++++++++---------- sidebars.json | 3 +- .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 31 ++++++++------------- .../SHOW-CREATE-MATERIALIZED-VIEW.md | 32 ++++++++++------------ .../async-materialized-view/faq.md | 8 ++++++ .../SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md | 30 ++++++++------------ .../SHOW-CREATE-MATERIALIZED-VIEW.md | 31 ++++++++++----------- versioned_sidebars/version-2.1-sidebars.json | 3 +- versioned_sidebars/version-3.0-sidebars.json | 3 +- 21 files changed, 215 insertions(+), 188 deletions(-) diff --git a/docs/query-acceleration/materialized-view/async-materialized-view/faq.md b/docs/query-acceleration/materialized-view/async-materialized-view/faq.md index 9c6daf62386..e474d52928b 100644 --- a/docs/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/docs/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -182,6 +182,14 @@ Reasons may be: 2. There may be a typographical error in the refresh keywords or a syntax error in the SQL definition of the materialized view. Check the SQL definition and creation statement for the materialized view for correctness. +### Q14: After the materialized view is refreshed successfully, there is still no data + +The materialized view determines whether the data needs to be updated based on its ability to retrieve version information from the base table or base table partitions. + +When encountering data lakes that currently do not support retrieving version information, such as JDBC Catalog, the refresh process will assume that the materialized view does not need to be updated. Therefore, when creating or refreshing a materialized view, you should specify complete instead of auto. + +For the progress of materialized view support for data lakes, please refer to[Data Lake Support Status.](./overview.md) + ## Queries and Transparent Rewriting ### Q1: How to confirm if a Materialized View hits, and how to find the reasons for Non-Hits? diff --git a/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index 1edd3626381..7e9d3b9eac2 100644 --- a/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/docs/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -30,8 +30,6 @@ View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ``` @@ -42,28 +40,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> > The name of the materialized view. +## Return Values + +|Column Name | Description | +| -- |------| +| Materialized View | Name of the materialized view | +| Create Materialized View | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: -| Privilege | Object | Notes | -| --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| Privilege | Object | Notes | +| --------- | ------ | ----------------------------------------------------------- | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | | ## Example 1. View the creation statement of an asynchronous materialized view - - ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. View the creation statement of a synchronized materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index c175f9525a4..60a264b8ea2 100644 --- a/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/docs/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -30,8 +30,6 @@ View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> ``` @@ -46,28 +44,27 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > The table to which the materialized view belongs. +## Return Values + +|Column Name | Description | +| -- |------| +| TableName | Name of the table | +| ViewName | Name of the materialized view | +| CreateStmt | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: | Privilege | Object | Notes | | --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | You need to have permissions for the table to which the current materialized view belongs | ## Examples -1. View the creation statement of an asynchronous materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. View the creation statement of a synchronized materialized view - - +1. View the creation statement of a synchronized materialized view ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file + ``` + \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/faq.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/faq.md index 5c321bf6786..16c38ac484e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -187,6 +187,14 @@ BUILD IMMEDIATE REFRESH AUTO ON MANUAL 2. 可能是构建物化的语句使用的 **关键词写错**或者物化定义 **SQL 语法有问题**,可以检查下物化定义 SQL 和创建物化语句是否正确。 +### Q14:物化视图刷新成功后,还是没有数据 + +物化视图判断数据是否需要更新依赖于能够获取到基表或基表分区的版本信息。 + +遇到目前不支持获取版本信息的数据湖, 例如jdbc catalog, 那么刷新的时候会认为物化视图是不需要更新的,因此创建或者刷新物化视图的时候应该指定 complete 而不是 auto + +物化视图支持数据湖的进度参考[数据湖支持情况](./overview.md) + ## 查询和透明改写 ### Q1:如何确认是否命中,如果不命中如何查看原因? diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index 8b3e5801468..86d47ba2588 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE ASYNC MATERIALIZED VIEW", - "language": "zh-CN" +"title": "SHOW CREATE ASYNC MATERIALIZED VIEW", +"language": "zh-CN" } --- @@ -26,7 +26,7 @@ under the License. ## 描述 -查看物化视图创建语句。 +查看异步物化视图创建语句。 ## 语法 @@ -40,24 +40,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> > 物化视图名称 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| Materialized View | 物化视图名 | +| Create Materialized View | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限(Privilege) | 对象(Object) | 说明(Notes) | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表(Table) | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:-------------------------------------------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | | -## 示例 +## 示例(Examples) 1. 查看异步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. 查看同步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index d4c1e84924d..194b809aab9 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -26,7 +26,7 @@ under the License. ## 描述 -查看物化视图创建语句。 +查看同步物化视图创建语句。 ## 语法 @@ -44,23 +44,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > 物化视图所属的表 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| TableName | 表名 | +| ViewName | 物化视图名 | +| CreateStmt | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限 | 对象 | 说明 | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表 | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:--------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | 需要拥有当前物化视图所属表的权限 | ## 示例(Examples) -1. 查看异步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. 查看同步物化视图创建语句 +1. 查看同步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md index 5c321bf6786..16c38ac484e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -187,6 +187,14 @@ BUILD IMMEDIATE REFRESH AUTO ON MANUAL 2. 可能是构建物化的语句使用的 **关键词写错**或者物化定义 **SQL 语法有问题**,可以检查下物化定义 SQL 和创建物化语句是否正确。 +### Q14:物化视图刷新成功后,还是没有数据 + +物化视图判断数据是否需要更新依赖于能够获取到基表或基表分区的版本信息。 + +遇到目前不支持获取版本信息的数据湖, 例如jdbc catalog, 那么刷新的时候会认为物化视图是不需要更新的,因此创建或者刷新物化视图的时候应该指定 complete 而不是 auto + +物化视图支持数据湖的进度参考[数据湖支持情况](./overview.md) + ## 查询和透明改写 ### Q1:如何确认是否命中,如果不命中如何查看原因? diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index 62f9f20345f..86d47ba2588 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE ASYNC MATERIALIZED VIEW", - "language": "zh-CN" +"title": "SHOW CREATE ASYNC MATERIALIZED VIEW", +"language": "zh-CN" } --- @@ -24,10 +24,9 @@ specific language governing permissions and limitations under the License. --> - ## 描述 -查看物化视图创建语句。 +查看异步物化视图创建语句。 ## 语法 @@ -37,28 +36,29 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ## 必选参数 -**1. <materialized_view_new_name>** +**1. `<materialized_view_new_name>`** > 物化视图名称 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| Materialized View | 物化视图名 | +| Create Materialized View | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限(Privilege) | 对象(Object) | 说明(Notes) | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表(Table) | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:-------------------------------------------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | | -## 示例 +## 示例(Examples) 1. 查看异步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. 查看同步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index 8f7e9503112..ccef76bef43 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE SYNC MATERIALIZED VIEW", - "language": "zh-CN" +"title": "SHOW CREATE SYNC MATERIALIZED VIEW", +"language": "zh-CN" } --- @@ -24,10 +24,9 @@ specific language governing permissions and limitations under the License. --> - ## 描述 -查看物化视图创建语句。 +查看同步物化视图创建语句。 ## 语法 @@ -45,23 +44,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > 物化视图所属的表 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| TableName | 表名 | +| ViewName | 物化视图名 | +| CreateStmt | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限 | 对象 | 说明 | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表 | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:--------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | 需要拥有当前物化视图所属表的权限 | ## 示例(Examples) -1. 查看异步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. 查看同步物化视图创建语句 +1. 查看同步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md index 5c321bf6786..16c38ac484e 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -187,6 +187,14 @@ BUILD IMMEDIATE REFRESH AUTO ON MANUAL 2. 可能是构建物化的语句使用的 **关键词写错**或者物化定义 **SQL 语法有问题**,可以检查下物化定义 SQL 和创建物化语句是否正确。 +### Q14:物化视图刷新成功后,还是没有数据 + +物化视图判断数据是否需要更新依赖于能够获取到基表或基表分区的版本信息。 + +遇到目前不支持获取版本信息的数据湖, 例如jdbc catalog, 那么刷新的时候会认为物化视图是不需要更新的,因此创建或者刷新物化视图的时候应该指定 complete 而不是 auto + +物化视图支持数据湖的进度参考[数据湖支持情况](./overview.md) + ## 查询和透明改写 ### Q1:如何确认是否命中,如果不命中如何查看原因? diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index 62f9f20345f..86d47ba2588 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE ASYNC MATERIALIZED VIEW", - "language": "zh-CN" +"title": "SHOW CREATE ASYNC MATERIALIZED VIEW", +"language": "zh-CN" } --- @@ -24,10 +24,9 @@ specific language governing permissions and limitations under the License. --> - ## 描述 -查看物化视图创建语句。 +查看异步物化视图创建语句。 ## 语法 @@ -37,28 +36,29 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ## 必选参数 -**1. <materialized_view_new_name>** +**1. `<materialized_view_new_name>`** > 物化视图名称 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| Materialized View | 物化视图名 | +| Create Materialized View | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限(Privilege) | 对象(Object) | 说明(Notes) | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表(Table) | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:-------------------------------------------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | | -## 示例 +## 示例(Examples) 1. 查看异步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. 查看同步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index 2736345aa22..ccef76bef43 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE SYNC MATERIALIZED VIEW", - "language": "zh-CN" +"title": "SHOW CREATE SYNC MATERIALIZED VIEW", +"language": "zh-CN" } --- @@ -24,11 +24,9 @@ specific language governing permissions and limitations under the License. --> - - ## 描述 -查看物化视图创建语句。 +查看同步物化视图创建语句。 ## 语法 @@ -46,23 +44,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > 物化视图所属的表 +## 返回值 + +| 列名 | 说明 | +| -- |------| +| TableName | 表名 | +| ViewName | 物化视图名 | +| CreateStmt | 物化视图创建语句 | + ## 权限控制 执行此 SQL 命令的用户必须至少具有以下权限: -| 权限 | 对象 | 说明 | -| :---------------- | :------------- | :------------------------------------ | -| SHOW_PRIV | 表 | 需要拥有当前物化视图的 SHOW_PRIV 权限 | +| 权限 | 对象 | 说明 | +| :---------------- | :------------- |:--------------------------| +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | 表 | 需要拥有当前物化视图所属表的权限 | ## 示例(Examples) -1. 查看异步物化视图创建语句 - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. 查看同步物化视图创建语句 +1. 查看同步物化视图创建语句 ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; diff --git a/sidebars.json b/sidebars.json index a3d121653bf..4cd9e7ac350 100644 --- a/sidebars.json +++ b/sidebars.json @@ -1891,7 +1891,8 @@ "sql-manual/sql-statements/table-and-view/async-materialized-view/PAUSE-MATERIALIZED-VIEW-JOB", "sql-manual/sql-statements/table-and-view/async-materialized-view/DROP-ASYNC-MATERIALIZED-VIEW", "sql-manual/sql-statements/table-and-view/async-materialized-view/REFRESH-MATERIALIZED-VIEW", - "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB" + "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB", + "sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW" ] }, { diff --git a/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md b/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md index cb622bb7ed6..50019343772 100644 --- a/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/versioned_docs/version-2.1/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -182,6 +182,14 @@ Reasons may be: 2. There may be a typographical error in the refresh keywords or a syntax error in the SQL definition of the materialized view. Check the SQL definition and creation statement for the materialized view for correctness. +### Q14: After the materialized view is refreshed successfully, there is still no data + +The materialized view determines whether the data needs to be updated based on its ability to retrieve version information from the base table or base table partitions. + +When encountering data lakes that currently do not support retrieving version information, such as JDBC Catalog, the refresh process will assume that the materialized view does not need to be updated. Therefore, when creating or refreshing a materialized view, you should specify complete instead of auto. + +For the progress of materialized view support for data lakes, please refer to[Data Lake Support Status.](./overview.md) + ## Queries and Transparent Rewriting ### Q1: How to confirm if a Materialized View hits, and how to find the reasons for Non-Hits? diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index bf4cc8fef18..8f00b7b6088 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE ASYNC MATERIALIZED VIEW", - "language": "en" +"title": "SHOW CREATE ASYNC MATERIALIZED VIEW", +"language": "en" } --- @@ -24,16 +24,12 @@ specific language governing permissions and limitations under the License. --> - - ## Description View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ``` @@ -44,28 +40,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> > The name of the materialized view. +## Return Values + +|Column Name | Description | +| -- |------| +| Materialized View | Name of the materialized view | +| Create Materialized View | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: -| Privilege | Object | Notes | -| --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| Privilege | Object | Notes | +| --------- | ------ | ----------------------------------------------------------- | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | | ## Example 1. View the creation statement of an asynchronous materialized view - - ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. View the creation statement of a synchronized materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index b85fbad017c..5468ca19500 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE SYNC MATERIALIZED VIEW", - "language": "en" +"title": "SHOW CREATE SYNC MATERIALIZED VIEW", +"language": "en" } --- @@ -24,15 +24,12 @@ specific language governing permissions and limitations under the License. --> - ## Description View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> ``` @@ -47,28 +44,27 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > The table to which the materialized view belongs. +## Return Values + +|Column Name | Description | +| -- |------| +| TableName | Name of the table | +| ViewName | Name of the materialized view | +| CreateStmt | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: | Privilege | Object | Notes | | --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | You need to have permissions for the table to which the current materialized view belongs | ## Examples -1. View the creation statement of an asynchronous materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. View the creation statement of a synchronized materialized view - - +1. View the creation statement of a synchronized materialized view ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file + ``` + \ No newline at end of file diff --git a/versioned_docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md b/versioned_docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md index 351ef1b14a1..ec1d98a51aa 100644 --- a/versioned_docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md +++ b/versioned_docs/version-3.0/query-acceleration/materialized-view/async-materialized-view/faq.md @@ -182,6 +182,14 @@ Reasons may be: 2. There may be a typographical error in the refresh keywords or a syntax error in the SQL definition of the materialized view. Check the SQL definition and creation statement for the materialized view for correctness. +### Q14: After the materialized view is refreshed successfully, there is still no data + +The materialized view determines whether the data needs to be updated based on its ability to retrieve version information from the base table or base table partitions. + +When encountering data lakes that currently do not support retrieving version information, such as JDBC Catalog, the refresh process will assume that the materialized view does not need to be updated. Therefore, when creating or refreshing a materialized view, you should specify complete instead of auto. + +For the progress of materialized view support for data lakes, please refer to[Data Lake Support Status.](./overview.md) + ## Queries and Transparent Rewriting ### Q1: How to confirm if a Materialized View hits, and how to find the reasons for Non-Hits? diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md index 91f3224dda7..8f00b7b6088 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE ASYNC MATERIALIZED VIEW", - "language": "en" +"title": "SHOW CREATE ASYNC MATERIALIZED VIEW", +"language": "en" } --- @@ -24,15 +24,12 @@ specific language governing permissions and limitations under the License. --> - ## Description View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ``` @@ -43,28 +40,25 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> > The name of the materialized view. +## Return Values + +|Column Name | Description | +| -- |------| +| Materialized View | Name of the materialized view | +| Create Materialized View | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: -| Privilege | Object | Notes | -| --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| Privilege | Object | Notes | +| --------- | ------ | ----------------------------------------------------------- | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | | ## Example 1. View the creation statement of an asynchronous materialized view - - ```sql SHOW CREATE MATERIALIZED VIEW partition_mv; ``` - -2. View the creation statement of a synchronized materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md index c175f9525a4..5468ca19500 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/sync-materialized-view/SHOW-CREATE-MATERIALIZED-VIEW.md @@ -1,7 +1,7 @@ --- { - "title": "SHOW CREATE SYNC MATERIALIZED VIEW", - "language": "en" +"title": "SHOW CREATE SYNC MATERIALIZED VIEW", +"language": "en" } --- @@ -30,8 +30,6 @@ View the materialized view creation statement. ## Syntax - - ```sql SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> ``` @@ -46,28 +44,27 @@ SHOW CREATE MATERIALIZED VIEW <materialized_view_name> ON <table_name> > The table to which the materialized view belongs. +## Return Values + +|Column Name | Description | +| -- |------| +| TableName | Name of the table | +| ViewName | Name of the materialized view | +| CreateStmt | Statement used to create the materialized view | + ## Access Control Requirements The user executing this SQL command must have at least the following permissions: | Privilege | Object | Notes | | --------- | ------ | ------------------------------------------------------------ | -| SHOW_PRIV | Table | Requires SHOW_PRIV permission on the current materialized view | +| SELECT_PRIV/LOAD_PRIV/ALTER_PRIV/CREATE_PRIV/DROP_PRIV | Table | You need to have permissions for the table to which the current materialized view belongs | ## Examples -1. View the creation statement of an asynchronous materialized view - - - - ```sql - SHOW CREATE MATERIALIZED VIEW partition_mv; - ``` - -2. View the creation statement of a synchronized materialized view - - +1. View the creation statement of a synchronized materialized view ```sql SHOW CREATE MATERIALIZED VIEW sync_agg_mv on lineitem; - ``` \ No newline at end of file + ``` + \ No newline at end of file diff --git a/versioned_sidebars/version-2.1-sidebars.json b/versioned_sidebars/version-2.1-sidebars.json index ee6784aa25f..6069ea8f7f1 100644 --- a/versioned_sidebars/version-2.1-sidebars.json +++ b/versioned_sidebars/version-2.1-sidebars.json @@ -1859,7 +1859,8 @@ "sql-manual/sql-statements/table-and-view/async-materialized-view/PAUSE-MATERIALIZED-VIEW-JOB", "sql-manual/sql-statements/table-and-view/async-materialized-view/DROP-ASYNC-MATERIALIZED-VIEW", "sql-manual/sql-statements/table-and-view/async-materialized-view/REFRESH-MATERIALIZED-VIEW", - "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB" + "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB", + "sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW" ] }, { diff --git a/versioned_sidebars/version-3.0-sidebars.json b/versioned_sidebars/version-3.0-sidebars.json index 2f89b927d92..a17d533c196 100644 --- a/versioned_sidebars/version-3.0-sidebars.json +++ b/versioned_sidebars/version-3.0-sidebars.json @@ -1931,7 +1931,8 @@ "sql-manual/sql-statements/table-and-view/async-materialized-view/PAUSE-MATERIALIZED-VIEW-JOB", "sql-manual/sql-statements/table-and-view/async-materialized-view/DROP-ASYNC-MATERIALIZED-VIEW", "sql-manual/sql-statements/table-and-view/async-materialized-view/REFRESH-MATERIALIZED-VIEW", - "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB" + "sql-manual/sql-statements/table-and-view/async-materialized-view/RESUME-MATERIALIZED-VIEW-JOB", + "sql-manual/sql-statements/table-and-view/async-materialized-view/SHOW-CREATE-ASYNC-MATERIALIZED-VIEW" ] }, { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org