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 404e68c9326 [docs]Fix statement docs of CANCAL, REFRESH, PAUSE and RESUME MATERIALIZED VIEW (#1902) 404e68c9326 is described below commit 404e68c932622a5a4f20fcfd8a94567af81c6efa Author: lsy3993 <110876560+lsy3...@users.noreply.github.com> AuthorDate: Mon Feb 10 11:10:47 2025 +0800 [docs]Fix statement docs of CANCAL, REFRESH, PAUSE and RESUME MATERIALIZED VIEW (#1902) ## Versions - [x] dev - [x] 3.0 - [x] 2.1 - [ ] 2.0 ## Languages - [x] Chinese - [x] English ## Docs Checklist - [ ] Checked by AI - [ ] Test Cases Built --- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 33 ++++++++--- .../PAUSE-MATERIALIZED-VIEW-JOB.md | 36 +++++++++--- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 62 ++++++++++++++++----- .../RESUME-MATERIALIZED-VIEW-JOB.md | 34 +++++++++--- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 36 +++++++++--- .../materialized-view/PAUSE-MATERIALIZED-VIEW.md | 37 ++++++++++--- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 61 ++++++++++++++++----- .../materialized-view/RESUME-MATERIALIZED-VIEW.md | 37 +++++++++---- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 37 +++++++++---- .../materialized-view/PAUSE-MATERIALIZED-VIEW.md | 38 +++++++++---- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 62 ++++++++++++++++----- .../materialized-view/RESUME-MATERIALIZED-VIEW.md | 38 +++++++++---- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 36 +++++++++--- .../materialized-view/PAUSE-MATERIALIZED-VIEW.md | 38 +++++++++---- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 63 ++++++++++++++++----- .../materialized-view/RESUME-MATERIALIZED-VIEW.md | 38 +++++++++---- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 36 ++++++++---- .../materialized-view/PAUSE-MATERIALIZED-VIEW.md | 40 ++++++++++---- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 62 ++++++++++++++++----- .../materialized-view/RESUME-MATERIALIZED-VIEW.md | 36 ++++++++---- .../CANCEL-MATERIALIZED-VIEW-TASK.md | 34 ++++++++---- .../PAUSE-MATERIALIZED-VIEW-JOB.md | 36 +++++++++--- .../materialized-view/REFRESH-MATERIALIZED-VIEW.md | 64 ++++++++++++++++------ .../RESUME-MATERIALIZED-VIEW-JOB.md | 35 ++++++++---- 24 files changed, 762 insertions(+), 267 deletions(-) diff --git a/docs/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/docs/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index 1b3979e66ca..6997ad7a5be 100644 --- a/docs/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/docs/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -29,23 +29,38 @@ under the License. This statement is used to cancel the task of materialized views -syntax: +## Syntax ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` +## Required Parameters +**1. `<task_id>`** +> Specifies the task id of materialized view. + + +**2. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | CANCEL is an ALTER operation on a materialized view | + ## Example -1. Cancel the task with id 1 in materialized view mv1 +- Cancel the task with id 1 in materialized view mv1 ```sql CANCEL MATERIALIZED VIEW TASK 1 on mv1; ``` - -## Keywords - - CANCEL, MATERIALIZED, VIEW, TASK - -## Best Practice diff --git a/docs/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md b/docs/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md index 1c119c03ceb..f140e6106a6 100644 --- a/docs/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md +++ b/docs/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md @@ -29,23 +29,41 @@ under the License. This statement is used to pause the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | PAUSE is an ALTER operation on a materialized view | + + +## Usage Notes + +- After you use this statement, you can use the RESUME materialized view statement to restore. + + ## Example -1. Pause scheduled scheduling of materialized view mv1 +- Pause scheduled scheduling of materialized view mv1 ```sql PAUSE MATERIALIZED VIEW JOB ON mv1; ``` - -## Keywords - - PAUSE, MATERIALIZED, VIEW - -## Best Practice diff --git a/docs/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/docs/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index 2bdb4e90445..c983927d3e9 100644 --- a/docs/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/docs/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -29,43 +29,75 @@ under the License. This statement is used to manually refresh the specified asynchronous materialized view -syntax: +## Syntax ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -Explanation: +Where: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +**2. `<refresh_type>`** +> Specifies the refresh type of this materialized view. +> +> The refresh type may be one of the partitionSpec, COMPLETE or AUTO. + +## Optional Parameters +**1. `<partition_name>`** +> Specifies the partition name when refresh the partition +> -Asynchronous refresh of data for a materialized view +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | REFRESH is an ALTER operation on a materialized view | + + +## Usage Notes - AUTO: The calculation will determine which partitions of the materialized view are not synchronized with the base table. (Currently, if the base table is an external table, it is considered to be always synchronized with the materialized view. Therefore, if the base table is an external table, it is necessary to specify `COMPLETE` or designate the partitions to be refreshed), and then proceed to refresh the corresponding partitions accordingly. - COMPLETE: It will forcibly refresh all partitions of the materialized view without checking whether the partitions are synchronized with the base table. - partitionSpec: It will forcibly refresh the specified partitions without checking whether the partitions are synchronized with the base table. -## Example +## Examples -1. Refresh materialized view mv1 (automatically calculate the partition to be refreshed) +- Refresh materialized view mv1 (automatically calculate the partition to be refreshed) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. Refresh partition named p_19950801_19950901 和 p_19950901_19951001 + +- Refresh partition named p_19950801_19950901 and p_19950901_19951001 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` -3. Force refresh of all materialized view data + +- Force refresh of all materialized view data ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## Keywords - - REFRESH, MATERIALIZED, VIEW - -## Best Practice - diff --git a/docs/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md b/docs/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md index bd18146158e..efc366be16a 100644 --- a/docs/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md +++ b/docs/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md @@ -28,23 +28,39 @@ under the License. This statement is used to temporarily restore the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | RESUME is an ALTER operation on a materialized view | + + +## Usage Notes + +- This statement is generally used after the pause materialized view statement + ## Example -1. Timed scheduling for restoring materialized view mv1 +- Timed scheduling for restoring materialized view mv1 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## Keywords - - RESUME, MATERIALIZED, VIEW - -## Best Practice diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index ad5008e8a79..661bc44d1f3 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -30,23 +30,41 @@ under the License. 该语句用于取消物化视图的 task -语法: +## 语法 ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` +## 必选参数 +**1. `<task_id>`** + +> 指定物化视图创建job的task id。 + + +**2. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | CANCEL 属于物化视图的ALTER操作 | + + ## 示例 -1. 取消物化视图 mv1 的 id 为 1 的 task +- 取消物化视图 mv1 的 id 为 1 的 task ```sql CANCEL MATERIALIZED VIEW TASK 1 on mv1; ``` - -## 关键词 - - CANCEL, MATERIALIZED, VIEW, TASK - -### 最佳实践 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md index 56c475ff348..f90919b2293 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md @@ -32,23 +32,42 @@ under the License. 该语句用于暂停物化视图的定时调度 -语法: +## 语法 ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | PAUSE 属于物化视图的ALTER操作 | + +## 注意事项 +- 当执行完PAUSE MATERIALIZED VIEW语句后,可以使用RESUME MATERIALIZED VIEW语句恢复暂停的任务 + + ## 示例 -1. 暂停物化视图 mv1 的定时调度 + +- 暂停物化视图 mv1 的定时调度 ```sql PAUSE MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - PAUSE, MATERIALIZED, VIEW - -### 最佳实践 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index 64c32700129..8fb0008e3f5 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -30,43 +30,76 @@ under the License. 该语句用于手动刷新指定的异步物化视图 -语法: +## 语法 ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -说明: +其中: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +**2. `<refresh_type>`** + +> 指定物化视图的刷新方式。 +> +> 其刷新方式可以是`COMPLETE`, `AUTO`, `partitionSpec` 三种之一 -异步刷新某个物化视图的数据 +## 可选参数 +**1. `<partition_name>`** +> 指定要刷新分区的分区名称 +> +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | REFRESH 属于物化视图的ALTER操作 | + +## 注意事项 - AUTO:会计算物化视图的哪些分区和基表不同步(目前,如果基表是外表,会被认为始终和物化视图同步,因此如果基表是外表,需要指定`COMPLETE`或指定要刷新的分区),然后刷新对应的分区 - COMPLETE:会强制刷新物化视图的所有分区,不会判断分区是否和基表同步 - partitionSpec:会强制刷新指定的分区,不会判断分区是否和基表同步 ## 示例 -1. 刷新物化视图 mv1(自动计算要刷新的分区) + +- 刷新物化视图 mv1(自动计算要刷新的分区) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 + +- 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` -3. 强制刷新物化视图全部数据 + +- 强制刷新物化视图全部数据 ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## 关键词 - - REFRESH, MATERIALIZED, VIEW - -### 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md index beb2f28a649..08292e048e5 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md @@ -30,23 +30,40 @@ under the License. 该语句用于暂恢复物化视图的定时调度 -语法: - +## 语法 ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | RESUME 属于物化视图的ALTER操作 | + +## 注意事项 +- 该语句一般在PAUSE MATERIALIZED VIEW语句后执行 + + ## 示例 -1. 恢复物化视图 mv1 的定时调度 +- 恢复物化视图 mv1 的定时调度 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - RESUME, MATERIALIZED, VIEW - -### 最佳实践 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index 8ca694cf3bf..fabefe85dbc 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -30,24 +30,41 @@ under the License. 该语句用于取消物化视图的 task -语法: +## 语法 ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` -## 示例 +## 必选参数 +**1. `<task_id>`** + +> 指定物化视图创建job的task id。 + + +**2. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: -1. 取消物化视图 mv1 的 id 为 1 的 task +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | CANCEL 属于物化视图的ALTER操作 | +## 示例 + +- 取消物化视图 mv1 的 id 为 1 的 task + ```sql CANCEL MATERIALIZED VIEW TASK 1 on mv1; ``` - -## 关键词 - - CANCEL, MATERIALIZED, VIEW, TASK - -## 最佳实践 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md index 967aeed7452..428feab6987 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md @@ -29,23 +29,41 @@ under the License. 该语句用于暂停物化视图的定时调度 -语法: +## 语法 ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | PAUSE 属于物化视图的ALTER操作 | + +## 注意事项 +- 当执行完PAUSE MATERIALIZED VIEW语句后,可以使用RESUME MATERIALIZED VIEW语句恢复暂停的任务 + + ## 示例 -1. 暂停物化视图 mv1 的定时调度 + +- 暂停物化视图 mv1 的定时调度 ```sql PAUSE MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - PAUSE, MATERIALIZED, VIEW - -## 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index ae6465d6d04..c2f0f80ad40 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -29,16 +29,53 @@ under the License. 该语句用于手动刷新指定的异步物化视图 -语法: +## 语法 ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -说明: +其中: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +**2. `<refresh_type>`** + +> 指定物化视图的刷新方式。 +> +> 其刷新方式可以是`COMPLETE`, `AUTO`, `partitionSpec` 三种之一 -异步刷新某个物化视图的数据 +## 可选参数 +**1. `<partition_name>`** +> 指定要刷新分区的分区名称 +> +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | REFRESH 属于物化视图的ALTER操作 | + +## 注意事项 - AUTO:会计算物化视图的哪些分区和基表不同步(目前,如果基表是外表,会被认为始终和物化视图同步,因此如果基表是外表,需要指定`COMPLETE`或指定要刷新的分区),然后刷新对应的分区 - COMPLETE:会强制刷新物化视图的所有分区,不会判断分区是否和基表同步 - partitionSpec:会强制刷新指定的分区,不会判断分区是否和基表同步 @@ -46,27 +83,22 @@ REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | ## 示例 -1. 刷新物化视图 mv1(自动计算要刷新的分区) +- 刷新物化视图 mv1(自动计算要刷新的分区) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 + +- 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` - -3. 强制刷新物化视图全部数据 + + +- 强制刷新物化视图全部数据 ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## 关键词 - - REFRESH, MATERIALIZED, VIEW - -## 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md index 50a5624348c..ed22f111a41 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md @@ -29,23 +29,39 @@ under the License. 该语句用于暂恢复物化视图的定时调度 -语法: - +## 语法 ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | RESUME 属于物化视图的ALTER操作 | + +## 注意事项 +- 该语句一般在PAUSE MATERIALIZED VIEW语句后执行 + + ## 示例 -1. 恢复物化视图 mv1 的定时调度 +- 恢复物化视图 mv1 的定时调度 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - RESUME, MATERIALIZED, VIEW - -## 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index ad5008e8a79..661bc44d1f3 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -30,23 +30,41 @@ under the License. 该语句用于取消物化视图的 task -语法: +## 语法 ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` +## 必选参数 +**1. `<task_id>`** + +> 指定物化视图创建job的task id。 + + +**2. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | CANCEL 属于物化视图的ALTER操作 | + + ## 示例 -1. 取消物化视图 mv1 的 id 为 1 的 task +- 取消物化视图 mv1 的 id 为 1 的 task ```sql CANCEL MATERIALIZED VIEW TASK 1 on mv1; ``` - -## 关键词 - - CANCEL, MATERIALIZED, VIEW, TASK - -### 最佳实践 diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md index 56c475ff348..e72d18a1f08 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md @@ -32,23 +32,41 @@ under the License. 该语句用于暂停物化视图的定时调度 -语法: +## 语法 ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | PAUSE 属于物化视图的ALTER操作 | + +## 注意事项 +- 当执行完PAUSE MATERIALIZED VIEW语句后,可以使用RESUME MATERIALIZED VIEW语句恢复暂停的任务 + + ## 示例 -1. 暂停物化视图 mv1 的定时调度 + +- 暂停物化视图 mv1 的定时调度 ```sql PAUSE MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - PAUSE, MATERIALIZED, VIEW - -### 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index 64c32700129..e0acbc07af6 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -30,43 +30,76 @@ under the License. 该语句用于手动刷新指定的异步物化视图 -语法: +## 语法 ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -说明: +其中: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + +**2. `<refresh_type>`** + +> 指定物化视图的刷新方式。 +> +> 其刷新方式可以是`COMPLETE`, `AUTO`, `partitionSpec` 三种之一 -异步刷新某个物化视图的数据 +## 可选参数 +**1. `<partition_name>`** +> 指定要刷新分区的分区名称 +> +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | REFRESH 属于物化视图的ALTER操作 | + +## 注意事项 - AUTO:会计算物化视图的哪些分区和基表不同步(目前,如果基表是外表,会被认为始终和物化视图同步,因此如果基表是外表,需要指定`COMPLETE`或指定要刷新的分区),然后刷新对应的分区 - COMPLETE:会强制刷新物化视图的所有分区,不会判断分区是否和基表同步 - partitionSpec:会强制刷新指定的分区,不会判断分区是否和基表同步 ## 示例 -1. 刷新物化视图 mv1(自动计算要刷新的分区) + +- 刷新物化视图 mv1(自动计算要刷新的分区) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 + +- 刷新名字为 p_19950801_19950901 和 p_19950901_19951001 的分区 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` - -3. 强制刷新物化视图全部数据 + + +- 强制刷新物化视图全部数据 ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## 关键词 - - REFRESH, MATERIALIZED, VIEW - -### 最佳实践 - diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md index beb2f28a649..98221e94ede 100644 --- a/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md @@ -30,23 +30,39 @@ under the License. 该语句用于暂恢复物化视图的定时调度 -语法: - +## 语法 ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` +## 必选参数 +**1. `<mv_name>`** + +> 指定物化视图的名字。 +> +> 物化视图的名字必须以字母字符(如果开启 unicode 名字支持,则可以是任意语言文字的字符)开头,并且不能包含空格或特殊字符,除非整个名字串用反引号括起来(例如`My Object`)。 +> +> 物化视图的名字不能使用保留关键字。 +> +> 有关更多详细信息,请参阅保留关键字。 + + + +## 权限控制 +执行此 SQL 命令的用户必须至少具有以下权限: + +| 权限(Privilege) | 对象(Object) | 说明(Notes) | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | 物化视图 | RESUME 属于物化视图的ALTER操作 | + +## 注意事项 +- 该语句一般在PAUSE MATERIALIZED VIEW语句后执行 + + ## 示例 -1. 恢复物化视图 mv1 的定时调度 +- 恢复物化视图 mv1 的定时调度 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## 关键词 - - RESUME, MATERIALIZED, VIEW - -### 最佳实践 - diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index 01c0947fa77..72419e14329 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -28,23 +28,37 @@ under the License. This statement is used to cancel the task of materialized views -syntax: +## Syntax ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` -## Examples +## Required Parameters +**1. `<task_id>`** +> Specifies the task id of materialized view. -1. Cancel the task with id 1 in materialized view mv1 - ```sql - CANCEL MATERIALIZED VIEW TASK 1 on mv1; - ``` - -## Keywords +**2. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: - CANCEL, MATERIALIZED, VIEW, TASK +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | CANCEL is an ALTER operation on a materialized view | -## Best Practice +## Example +- Cancel the task with id 1 in materialized view mv1 + + ```sql + CANCEL MATERIALIZED VIEW TASK 1 on mv1; + ``` diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md index 2a1dab54181..ecd76e79aa6 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW.md @@ -30,23 +30,41 @@ under the License. This statement is used to pause the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` -## Examples -1. Pause scheduled scheduling of materialized view mv1 +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | PAUSE is an ALTER operation on a materialized view | - ```sql - PAUSE MATERIALIZED VIEW JOB ON mv1; - ``` - -## Keywords - PAUSE, MATERIALIZED, VIEW +## Usage Notes -## Best Practice +- After you use this statement, you can use the RESUME materialized view statement to restore. + +## Example + +- Pause scheduled scheduling of materialized view mv1 + + ```sql + PAUSE MATERIALIZED VIEW JOB ON mv1; + ``` diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index 5140f0cd6af..3850d071345 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -28,15 +28,52 @@ under the License. This statement is used to manually refresh the specified asynchronous materialized view -syntax: +## Syntax ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -Explanation: +Where: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +**2. `<refresh_type>`** +> Specifies the refresh type of this materialized view. +> +> The refresh type may be one of the partitionSpec, COMPLETE or AUTO. + +## Optional Parameters +**1. `<partition_name>`** +> Specifies the partition name when refresh the partition +> + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: -Asynchronous refresh of data for a materialized view +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | REFRESH is an ALTER operation on a materialized view | + + +## Usage Notes - AUTO: The calculation will determine which partitions of the materialized view are not synchronized with the base table. (Currently, if the base table is an external table, it is considered to be always synchronized with the materialized view. Therefore, if the base table is an external table, it is necessary to specify `COMPLETE` or designate the partitions to be refreshed), and then proceed to refresh the corresponding partitions accordingly. - COMPLETE: It will forcibly refresh all partitions of the materialized view without checking whether the partitions are synchronized with the base table. @@ -44,27 +81,22 @@ Asynchronous refresh of data for a materialized view ## Examples -1. Refresh materialized view mv1 (automatically calculate the partition to be refreshed) +- Refresh materialized view mv1 (automatically calculate the partition to be refreshed) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. Refresh partition named p_19950801_19950901 和 p_19950901_19951001 + +- Refresh partition named p_19950801_19950901 and p_19950901_19951001 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` - -3. Force refresh of all materialized view data + + +- Force refresh of all materialized view data ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## Keywords - - REFRESH, MATERIALIZED, VIEW - -## Best Practice - diff --git a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md index edb80b0f8ca..3e02f09b90d 100644 --- a/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-2.1/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW.md @@ -30,23 +30,39 @@ under the License. This statement is used to temporarily restore the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` -## Examples +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. -1. Timed scheduling for restoring materialized view mv1 +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | RESUME is an ALTER operation on a materialized view | + + +## Usage Notes + +- This statement is generally used after the pause materialized view statement + +## Example + +- Timed scheduling for restoring materialized view mv1 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## Keywords - - RESUME, MATERIALIZED, VIEW - -## Best Practice diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md index 1b3979e66ca..626da02795d 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/CANCEL-MATERIALIZED-VIEW-TASK.md @@ -29,23 +29,37 @@ under the License. This statement is used to cancel the task of materialized views -syntax: +## Syntax ```sql -CANCEL MATERIALIZED VIEW TASK taskId=INTEGER_VALUE ON mvName=multipartIdentifier +CANCEL MATERIALIZED VIEW TASK <task_id> ON <mv_name> ``` +## Required Parameters +**1. `<task_id>`** +> Specifies the task id of materialized view. + + +**2. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | CANCEL is an ALTER operation on a materialized view | + ## Example -1. Cancel the task with id 1 in materialized view mv1 +- Cancel the task with id 1 in materialized view mv1 ```sql CANCEL MATERIALIZED VIEW TASK 1 on mv1; ``` - -## Keywords - - CANCEL, MATERIALIZED, VIEW, TASK - -## Best Practice - diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md index 1c119c03ceb..f140e6106a6 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/PAUSE-MATERIALIZED-VIEW-JOB.md @@ -29,23 +29,41 @@ under the License. This statement is used to pause the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -PAUSE MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +PAUSE MATERIALIZED VIEW JOB ON <mv_name> ``` +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | PAUSE is an ALTER operation on a materialized view | + + +## Usage Notes + +- After you use this statement, you can use the RESUME materialized view statement to restore. + + ## Example -1. Pause scheduled scheduling of materialized view mv1 +- Pause scheduled scheduling of materialized view mv1 ```sql PAUSE MATERIALIZED VIEW JOB ON mv1; ``` - -## Keywords - - PAUSE, MATERIALIZED, VIEW - -## Best Practice diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md index 2bdb4e90445..7607886bb8d 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/REFRESH-MATERIALIZED-VIEW.md @@ -29,43 +29,75 @@ under the License. This statement is used to manually refresh the specified asynchronous materialized view -syntax: +## Syntax ```sql -REFRESH MATERIALIZED VIEW mvName=multipartIdentifier (partitionSpec | COMPLETE | AUTO) +REFRESH MATERIALIZED VIEW <mv_name> <refresh_type> ``` -Explanation: +Where: +```sql +refresh_type + : { <partitionSpec> | COMPLETE | AUTO } +``` + +```sql +partitionSpec + : PARTITIONS (<partition_name> [, <partition_name> [, ... ] ]) +``` + +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +**2. `<refresh_type>`** +> Specifies the refresh type of this materialized view. +> +> The refresh type may be one of the partitionSpec, COMPLETE or AUTO. + +## Optional Parameters +**1. `<partition_name>`** +> Specifies the partition name when refresh the partition +> + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: -Asynchronous refresh of data for a materialized view +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | REFRESH is an ALTER operation on a materialized view | + + +## Usage Notes - AUTO: The calculation will determine which partitions of the materialized view are not synchronized with the base table. (Currently, if the base table is an external table, it is considered to be always synchronized with the materialized view. Therefore, if the base table is an external table, it is necessary to specify `COMPLETE` or designate the partitions to be refreshed), and then proceed to refresh the corresponding partitions accordingly. - COMPLETE: It will forcibly refresh all partitions of the materialized view without checking whether the partitions are synchronized with the base table. - partitionSpec: It will forcibly refresh the specified partitions without checking whether the partitions are synchronized with the base table. -## Example +## Examples -1. Refresh materialized view mv1 (automatically calculate the partition to be refreshed) +- Refresh materialized view mv1 (automatically calculate the partition to be refreshed) ```sql REFRESH MATERIALIZED VIEW mv1 AUTO; ``` -2. Refresh partition named p_19950801_19950901 和 p_19950901_19951001 + +- Refresh partition named p_19950801_19950901 and p_19950901_19951001 ```sql REFRESH MATERIALIZED VIEW mv1 partitions(p_19950801_19950901,p_19950901_19951001); ``` - -3. Force refresh of all materialized view data + + +- Force refresh of all materialized view data ```sql REFRESH MATERIALIZED VIEW mv1 complete; ``` - -## Keywords - - REFRESH, MATERIALIZED, VIEW - -## Best Practice - diff --git a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md index bd18146158e..0c002085ac6 100644 --- a/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md +++ b/versioned_docs/version-3.0/sql-manual/sql-statements/table-and-view/materialized-view/RESUME-MATERIALIZED-VIEW-JOB.md @@ -28,23 +28,38 @@ under the License. This statement is used to temporarily restore the scheduled scheduling of materialized views -syntax: +## Syntax ```sql -RESUME MATERIALIZED VIEW JOB ON mvName=multipartIdentifier +RESUME MATERIALIZED VIEW JOB ON <mv_name> ``` +## Required Parameters +**1. `<mv_name>`** +> Specifies the materialized view name. +> +> The materialized view name must start with a letter character (or any language character if unicode name support is enabled) and cannot contain spaces or special characters unless the entire materialized view name string is enclosed in backticks (e.g., `My Object`). +> +> The materialized view name cannot use reserved keywords. +> +> For more details, see Reserved Keywords. + +## Access Control Requirements +Users executing this SQL command must have at least the following privileges: + +| Privilege | Object | Notes | +| :--------- | :----- | :------------------------------------------- | +| ALTER_PRIV | Materialized View | RESUME is an ALTER operation on a materialized view | + + +## Usage Notes + +- This statement is generally used after the pause materialized view statement + ## Example -1. Timed scheduling for restoring materialized view mv1 +- Timed scheduling for restoring materialized view mv1 ```sql RESUME MATERIALIZED VIEW JOB ON mv1; ``` - -## Keywords - - RESUME, MATERIALIZED, VIEW - -## Best Practice - --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org