Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix database related documentation #1927

Merged
merged 3 commits into from
Feb 6, 2025

Conversation

xyfsjq
Copy link
Contributor

@xyfsjq xyfsjq commented Jan 23, 2025

Versions

  • dev
  • 3.0
  • 2.1
  • 2.0

Languages

  • Chinese
  • English

Docs Checklist

  • Checked by AI
  • Test Cases Built

@@ -27,79 +27,70 @@ under the License.

## Description

This statement is used to set properties of the specified database. (administrator only)
This statement is used to set the properties of the specified database. (For administrators only)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This statement is used to set the properties of the specified database. (For administrators only)
This statement is used to set the properties of the specified database.


```sql
ALTER DATABASE db_name SET DATA QUOTA quota;
ALTER DATABASE <db_name> RENAME|SET DATA QUOTA|REPLICA QUOT <new_db_name>|<quota> [PROPERTIES ("<key>"="<value>", ...)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这语法不太对。其实是三个语法

  • rename
  • set quota
  • set properties
    现在这个语法和实际的对不上
Suggested change
ALTER DATABASE <db_name> RENAME|SET DATA QUOTA|REPLICA QUOT <new_db_name>|<quota> [PROPERTIES ("<key>"="<value>", ...)]
ALTER DATABASE <db_name> RENAME <new_name>
ALTER DATABASE <db_name> SET { DATA | REPLICA | TRANSACTION } QUOTA <quota>
ALTER DATABASE <db_name> SET PROPERTIES ("<key>" = "<value>" [, ...])

@@ -27,79 +27,70 @@ under the License.

## Description

This statement is used to set properties of the specified database. (administrator only)
This statement is used to set the properties of the specified database. (For administrators only)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

描述和语义不符。alter database 不止可以设置属性,还能改动 db 名字,以及设定 db 的多种 quota。需要在描述中,把上面的内容都涉及到

CREATE DATABASE [IF NOT EXISTS] db_name
[PROPERTIES ("key"="value", ...)];
CREATE DATABASE [IF NOT EXISTS] <db_name>
[PROPERTIES ("<key>"="<value>", ...)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
[PROPERTIES ("<key>"="<value>", ...)];
[PROPERTIES ("<key>"="<value>" [ , ... ])];


```sql
DROP DATABASE [IF EXISTS] db_name [FORCE];
DROP DATABASE [IF EXISTS] <db_name> [<FORCE>];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不是参数的部分,不用加尖括号

Suggested change
DROP DATABASE [IF EXISTS] <db_name> [<FORCE>];
DROP DATABASE [IF EXISTS] <db_name> [FORCE];

## Example
## Optional parameters

** 1. `<FORCE>`**
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
** 1. `<FORCE>`**
** 1. `FORCE`**


```sql
SHOW CREATE DATABASE db_name;
SHOW CREATE DATABASE [<catalog>].<db_name>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SHOW CREATE DATABASE [<catalog>].<db_name>;
SHOW CREATE DATABASE [<catalog_name>.]<db_name>;

Comment on lines 50 to 52
| Database | Create Database |
|:---------|:-----------|
| Database Name | Corresponding database creation statement |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Database | Create Database |
|:---------|:-----------|
| Database Name | Corresponding database creation statement |
| Column | Description |
|:---------|:-----------|
| Database | Database name |
| Create Database | Corresponding database creation statement |

Comment on lines 45 to 47
| DbName |
|:---------|
| Database Name |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

和上一个文件一样的问题

Comment on lines 48 to 50
| Database |
|:-------|
| Database Name |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

@KassieZ KassieZ added has comments Some comments not resolved yet and removed request review labels Jan 24, 2025
@xyfsjq xyfsjq requested a review from morrySnow January 24, 2025 07:34
ALTER DATABASE db_name RENAME new_db_name;
```
** 1. `<db_name>`**
> Database Name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> Database Name
> Specifies the identifier for the database to alter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


3) Set the quota for the number of copies of the database
** 2. `<new_db_name>`**
> New database name
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
> New database name
> Specifies the new identifier for the database

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@morrySnow morrySnow requested a review from KassieZ February 5, 2025 03:32
@KassieZ KassieZ merged commit 814fe2d into apache:master Feb 6, 2025
1 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has comments Some comments not resolved yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants