morrySnow commented on code in PR #1923:
URL: https://github.com/apache/doris-website/pull/1923#discussion_r1928057673
##########
docs/sql-manual/sql-statements/table-and-view/view/ALTER-VIEW.md:
##########
@@ -24,47 +24,61 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
## Description
-This statement is used to modify the definition of a view
+This statement is used to modify the definition of a logical view.
-grammar:
+## Syntax
```sql
-ALTER VIEW
-[db_name.]view_name
-(column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+ALTER VIEW [db_name.]<view_name>
+ ([column_definition])
Review Comment:
```suggestion
ALTER VIEW [<db_name>.]<view_name>
([<column_definition>])
```
##########
docs/sql-manual/sql-statements/table-and-view/view/ALTER-VIEW.md:
##########
@@ -24,47 +24,61 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
## Description
-This statement is used to modify the definition of a view
+This statement is used to modify the definition of a logical view.
-grammar:
+## Syntax
```sql
-ALTER VIEW
-[db_name.]view_name
-(column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+ALTER VIEW [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
```
-illustrate:
+Where:
+```sql
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
Review Comment:
```suggestion
<column_name> [COMMENT '<comment>'] [,...]
```
##########
docs/sql-manual/sql-statements/table-and-view/view/ALTER-VIEW.md:
##########
@@ -24,47 +24,61 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
## Description
-This statement is used to modify the definition of a view
+This statement is used to modify the definition of a logical view.
-grammar:
+## Syntax
```sql
-ALTER VIEW
-[db_name.]view_name
-(column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+ALTER VIEW [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
```
-illustrate:
+Where:
+```sql
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
+```
-- Views are all logical, and the data in them will not be stored on physical
media. When querying, the view will be used as a subquery in the statement.
Therefore, modifying the definition of the view is equivalent to modifying
query_stmt.
-- query_stmt is any supported SQL
+## Required Parameters
-## Example
+**<view_name>**
Review Comment:
1. 需要有序号
2. 需要用反引号包裹变量部分,防止转义
```suggestion
**1. `<view_name>`**
```
##########
docs/sql-manual/sql-statements/table-and-view/view/ALTER-VIEW.md:
##########
@@ -24,47 +24,61 @@ specific language governing permissions and limitations
under the License.
-->
-
-
-
## Description
-This statement is used to modify the definition of a view
+This statement is used to modify the definition of a logical view.
-grammar:
+## Syntax
```sql
-ALTER VIEW
-[db_name.]view_name
-(column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+ALTER VIEW [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
```
-illustrate:
+Where:
+```sql
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
+```
-- Views are all logical, and the data in them will not be stored on physical
media. When querying, the view will be used as a subquery in the statement.
Therefore, modifying the definition of the view is equivalent to modifying
query_stmt.
-- query_stmt is any supported SQL
+## Required Parameters
-## Example
+**<view_name>**
+> The identifier (i.e., name) of the view; it must be unique within the
database where the view is created.
+> The identifier must start with a letter character (if Unicode name support
is enabled, it can be a character in any language) and cannot contain spaces or
special characters unless the entire identifier string is enclosed in backticks
(e.g., `My View`).
+> The identifier cannot use reserved keywords.
+> For more details, see identifier requirements and reserved keywords.
-1. Modify the view example_view on example_db
+**<query_stmt>**
+> The SELECT query statement that defines the view.
-```sql
-ALTER VIEW example_db.example_view
-(
-c1 COMMENT "column 1",
-c2 COMMENT "column 2",
-c3 COMMENT "column 3"
-)
-AS SELECT k1, k2, SUM(v1) FROM example_table
-GROUP BY k1, k2
-```
+## Optional Parameters
-## Keywords
+**<db_name>**
+> The name of the database where the view resides. If not specified, the
current database is used by default.
-```text
-ALTER, VIEW
-```
+**<column_definition>**
+> The column definitions of the view.
-## Best Practice
+## Access Control Requirements
+
+| Privilege | Object | Notes |
+|---------------|---------|---------------------------------------------|
+| Alter_priv | View | Alter_priv privilege is required on the view being
modified. |
Review Comment:
```suggestion
| ALTER_PRIV | View | Alter_priv privilege is required on the view
being modified. |
```
##########
docs/sql-manual/sql-statements/table-and-view/view/CREATE-VIEW.md:
##########
@@ -27,34 +27,65 @@ under the License.
## Description
-This statement is used to create a logical view
-grammar:
+This statement is used to create a logical view through a specified query
statement.
+## Syntax
+
+```sql
+CREATE VIEW [IF NOT EXISTS] [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
+```
+
+Where:
```sql
-CREATE VIEW [IF NOT EXISTS]
- [db_name.]view_name
- (column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
```
+## Required Parameters
+
+**<view_name>**
+> The identifier (i.e., name) of the view; it must be unique within the
database where the view is created.
+> The identifier must start with a letter character (if Unicode name support
is enabled, it can be a character in any language) and cannot contain spaces or
special characters unless the entire identifier string is enclosed in backticks
(e.g., `My View`).
+> The identifier cannot use reserved keywords.
+> For more details, see identifier requirements and reserved keywords.
+
+**<query_stmt>**
+> The SELECT query statement that defines the view.
+
+## Optional Parameters
+
+**<db_name>**
+> The name of the database where the view resides. If not specified, the
current database is used by default.
-illustrate:
+**<column_definition>**
+> The column definitions of the view.
-- Views are logical views and have no physical storage. All queries on the
view are equivalent to the sub-queries corresponding to the view.
-- query_stmt is any supported SQL
+## Access Control Requirements
-## Example
+| Privilege | Object | Notes
|
+|---------------|---------|----------------------------------------------------------------------------------------------|
+| Create_Priv | Database|
|
+| Select_Priv | Table, View | Select_Priv privilege is required on the
tables, views, or materialized views being queried. |
Review Comment:
```suggestion
| CREATE_PRIV | Database|
|
| SELECT_PRIV | Table, View | Select_Priv privilege is required on the
tables, views, or materialized views being queried. |
```
##########
docs/sql-manual/sql-statements/table-and-view/view/CREATE-VIEW.md:
##########
@@ -27,34 +27,65 @@ under the License.
## Description
-This statement is used to create a logical view
-grammar:
+This statement is used to create a logical view through a specified query
statement.
+## Syntax
+
+```sql
+CREATE VIEW [IF NOT EXISTS] [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
+```
+
+Where:
```sql
-CREATE VIEW [IF NOT EXISTS]
- [db_name.]view_name
- (column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
```
+## Required Parameters
+
+**<view_name>**
+> The identifier (i.e., name) of the view; it must be unique within the
database where the view is created.
+> The identifier must start with a letter character (if Unicode name support
is enabled, it can be a character in any language) and cannot contain spaces or
special characters unless the entire identifier string is enclosed in backticks
(e.g., `My View`).
+> The identifier cannot use reserved keywords.
+> For more details, see identifier requirements and reserved keywords.
+
+**<query_stmt>**
+> The SELECT query statement that defines the view.
+
+## Optional Parameters
+
+**<db_name>**
Review Comment:
和 ALTER VIEW 的参数部分一样的问题
##########
docs/sql-manual/sql-statements/table-and-view/view/CREATE-VIEW.md:
##########
@@ -27,34 +27,65 @@ under the License.
## Description
-This statement is used to create a logical view
-grammar:
+This statement is used to create a logical view through a specified query
statement.
+## Syntax
+
+```sql
+CREATE VIEW [IF NOT EXISTS] [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
+```
+
+Where:
```sql
-CREATE VIEW [IF NOT EXISTS]
- [db_name.]view_name
- (column1[ COMMENT "col comment"][, column2, ...])
-AS query_stmt
+column_definition:
+ column_name [COMMENT 'comment'] [,...]
Review Comment:
```suggestion
<column_name> [COMMENT '<comment>'] [,...]
```
##########
docs/sql-manual/sql-statements/table-and-view/view/CREATE-VIEW.md:
##########
@@ -27,34 +27,65 @@ under the License.
## Description
-This statement is used to create a logical view
-grammar:
+This statement is used to create a logical view through a specified query
statement.
+## Syntax
+
+```sql
+CREATE VIEW [IF NOT EXISTS] [db_name.]<view_name>
+ ([column_definition])
+AS <query_stmt>
Review Comment:
```suggestion
CREATE VIEW [IF NOT EXISTS] [<db_name>.]<view_name>
([<column_definition>])
AS <query_stmt>
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]