You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/04/12 00:44:24 UTC
[incubator-doris] branch master updated: Utility-Statements SQL Help (#8952)
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new 667eac9b7d Utility-Statements SQL Help (#8952)
667eac9b7d is described below
commit 667eac9b7d89b2390e7e0e0ad2ce6c50435fdf1c
Author: jiafeng.zhang <zh...@gmail.com>
AuthorDate: Tue Apr 12 08:44:16 2022 +0800
Utility-Statements SQL Help (#8952)
Utility-Statements SQL Help
---
.../Utility-Statements/DESCRIBE.md | 28 ++++++++
.../sql-reference-v2/Utility-Statements/HELP.md | 76 ++++++++++++++++++++++
.../sql-reference-v2/Utility-Statements/USE.md | 19 ++++++
.../Utility-Statements/DESCRIBE.md | 30 ++++++++-
.../sql-reference-v2/Utility-Statements/HELP.md | 75 +++++++++++++++++++++
.../sql-reference-v2/Utility-Statements/USE.md | 19 ++++++
6 files changed, 246 insertions(+), 1 deletion(-)
diff --git a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
index e854bdd6df..ae0f168073 100644
--- a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
+++ b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
@@ -26,10 +26,38 @@ under the License.
## DESCRIBE
+### Name
+
+DESCRIBE
+
### Description
+This statement is used to display the schema information of the specified table
+
+grammar:
+
+```sql
+DESC[RIBE] [db_name.]table_name [ALL];
+````
+
+illustrate:
+
+1. If ALL is specified, the schemas of all indexes (rollup) of the table will be displayed
+
### Example
+1. Display the Base table schema
+
+ ```sql
+ DESC table_name;
+ ````
+
+2. Display the schema of all indexes of the table
+
+ ```sql
+ DESC db1.table_name ALL;
+ ````
+
### Keywords
DESCRIBE
diff --git a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/HELP.md b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
index 29a43b975a..33ba93c402 100644
--- a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
+++ b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
@@ -26,10 +26,86 @@ under the License.
## HELP
+### Name
+
+HELP
+
### Description
+The directory of help can be queried by changing the command
+
+grammar:
+
+```` sql
+HELP <item>
+````
+
+All Doris commands can be listed with `help`
+
+```sql
+List of all MySQL commands:
+Note that all text commands must be first on line and end with ';'
+? (\?) Synonym for `help'.
+clear (\c) Clear the current input statement.
+connect (\r) Reconnect to the server. Optional arguments are db and host.
+delimiter (\d) Set statement delimiter.
+edit (\e) Edit command with $EDITOR.
+ego (\G) Send command to mysql server, display result vertically.
+exit (\q) Exit mysql. Same as quit.
+go (\g) Send command to mysql server.
+help (\h) Display this help.
+nopager (\n) Disable pager, print to stdout.
+note (\t) Don't write into outfile.
+pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
+print (\p) Print current command.
+prompt (\R) Change your mysql prompt.
+quit (\q) Quit mysql.
+rehash (\#) Rebuild completion hash.
+source (\.) Execute an SQL script file. Takes a file name as an argument.
+status (\s) Get status information from the server.
+system (\!) Execute a system shell command.
+tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
+use (\u) Use another database. Takes database name as argument.
+charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
+warnings (\W) Show warnings after every statement.
+nowarning (\w) Don't show warnings after every statement.
+resetconnection(\x) Clean session context.
+
+For server side help, type 'help contents'
+````
+
+Get the Doris SQL help contents via `help contents`
+
+```sql
+Many help items for your request exist.
+To make a more specific request, please type 'help <item>',
+where <item> is one of the following
+categories:
+ sql-functions
+ sql-statements
+````
+
### Example
+1. List all SQL help contents of Doris
+
+ ```sql
+ help contents
+ ````
+
+2. The command to list all function directories of the Doris cluster
+
+ ```sql
+ help sql-functions
+ ````
+
+3. List all functions under the date function
+
+ ```sql
+ help date-time-functions
+ ````
+
+
### Keywords
HELP
diff --git a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/USE.md b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/USE.md
index 00ce4dc298..79cab5508e 100644
--- a/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/USE.md
+++ b/new-docs/en/sql-manual/sql-reference-v2/Utility-Statements/USE.md
@@ -26,10 +26,29 @@ under the License.
## USE
+### Name
+
+USE
+
### Description
+The USE command allows us to use the database
+
+grammar:
+
+````SQL
+USE <DATABASE_NAME>
+````
+
### Example
+1. If the demo database exists, try accessing it:
+
+ ```sql
+ mysql> use demo;
+ Database changed
+ ````
+
### Keywords
USE
diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
index 3d887dcc98..40ada88427 100644
--- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
+++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/DESCRIBE.md
@@ -26,13 +26,41 @@ under the License.
## DESCRIBE
+### Name
+
+DESCRIBE
+
### Description
+该语句用于展示指定 table 的 schema 信息
+
+语法:
+
+```sql
+DESC[RIBE] [db_name.]table_name [ALL];
+```
+
+说明:
+
+1. 如果指定 ALL,则显示该 table 的所有 index(rollup) 的 schema
+
### Example
+1. 显示Base表Schema
+
+ ```sql
+ DESC table_name;
+ ```
+
+2. 显示表所有 index 的 schema
+
+ ```sql
+ DESC db1.table_name ALL;
+ ```
+
### Keywords
- DESCRIBE
+ DESCRIBE, DESC
### Best Practice
diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/HELP.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
index 20f6e1a369..1993db3a58 100644
--- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
+++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/HELP.md
@@ -26,10 +26,85 @@ under the License.
## HELP
+### Name
+
+HELP
+
### Description
+通过改命令可以查询到帮助的目录
+
+语法:
+
+``` sql
+HELP <item>
+```
+
+可以通过 `help` 列出所有的 Doris 命令
+
+```sql
+List of all MySQL commands:
+Note that all text commands must be first on line and end with ';'
+? (\?) Synonym for `help'.
+clear (\c) Clear the current input statement.
+connect (\r) Reconnect to the server. Optional arguments are db and host.
+delimiter (\d) Set statement delimiter.
+edit (\e) Edit command with $EDITOR.
+ego (\G) Send command to mysql server, display result vertically.
+exit (\q) Exit mysql. Same as quit.
+go (\g) Send command to mysql server.
+help (\h) Display this help.
+nopager (\n) Disable pager, print to stdout.
+notee (\t) Don't write into outfile.
+pager (\P) Set PAGER [to_pager]. Print the query results via PAGER.
+print (\p) Print current command.
+prompt (\R) Change your mysql prompt.
+quit (\q) Quit mysql.
+rehash (\#) Rebuild completion hash.
+source (\.) Execute an SQL script file. Takes a file name as an argument.
+status (\s) Get status information from the server.
+system (\!) Execute a system shell command.
+tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
+use (\u) Use another database. Takes database name as argument.
+charset (\C) Switch to another charset. Might be needed for processing binlog with multi-byte charsets.
+warnings (\W) Show warnings after every statement.
+nowarning (\w) Don't show warnings after every statement.
+resetconnection(\x) Clean session context.
+
+For server side help, type 'help contents'
+```
+
+通过 `help contents` 获取 Doris SQL 帮助目录
+
+```sql
+Many help items for your request exist.
+To make a more specific request, please type 'help <item>',
+where <item> is one of the following
+categories:
+ sql-functions
+ sql-statements
+```
+
### Example
+1. 列出 Doris 所有的 SQL 帮助目录
+
+ ```sql
+ help contents
+ ```
+
+2. 列出 Doris 集群所有函数目录的命令
+
+ ```sql
+ help sql-functions
+ ```
+
+3. 列出日期函数下的所有函数列表
+
+ ```sql
+ help date-time-functions
+ ```
+
### Keywords
HELP
diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/USE.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/USE.md
index 9516afae6f..152d0814ec 100644
--- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/USE.md
+++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Utility-Statements/USE.md
@@ -26,10 +26,29 @@ under the License.
## USE
+### Name
+
+USE
+
### Description
+USE 命令可以让我们来使用数据库
+
+语法:
+
+```SQL
+USE <DATABASE_NAME>
+```
+
### Example
+1. 如果 demo 数据库存在,尝试存取它:
+
+ ```sql
+ mysql> use demo;
+ Database changed
+ ```
+
### Keywords
USE
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org