From 4462da742ffeacdaa651ebe762f8e7f9fa4db616 Mon Sep 17 00:00:00 2001 From: "jiafeng.zhang" Date: Wed, 13 Apr 2022 09:49:21 +0800 Subject: [PATCH] [Refactor][Doc] add show help doc (#8912) --- .../SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md | 0 .../Show-Statements/SHOW-ALTER.md | 40 ++++++ .../Show-Statements/SHOW-BACKENDS.md | 25 ++++ .../Show-Statements/SHOW-BACKUP.md | 43 +++++++ .../Show-Statements/SHOW-BROKER.md | 19 +++ .../Show-Statements/SHOW-COLUMNS.md | 18 +++ .../Show-Statements/SHOW-CREATE-FUNCTION.md | 24 ++++ .../SHOW-CREATE-ROUTINE-LOAD.md | 25 ++++ .../Show-Statements/SHOW-CREATE-TABLE.md | 23 ++++ .../Show-Statements/SHOW-DATA.md | 81 ++++++++++++ .../Show-Statements/SHOW-DATABASE-ID.md | 18 +++ .../Show-Statements/SHOW-DATABASES.md | 12 ++ .../Show-Statements/SHOW-DELETE.md | 18 +++ .../Show-Statements/SHOW-DYNAMIC-PARTITION.md | 18 +++ .../Show-Statements/SHOW-ENCRYPT-KEY.md | 37 ++++++ .../Show-Statements/SHOW-EXPORT.md | 57 +++++++++ .../Show-Statements/SHOW-FRONTENDS.md | 22 ++++ .../Show-Statements/SHOW-FUNCTIONS.md | 55 ++++++++ .../Show-Statements/SHOW-GRANTS.md | 36 ++++++ .../Show-Statements/SHOW-INDEX.md | 20 +++ .../Show-Statements/SHOW-LAST-INSERT.md | 76 +++++++++++ .../Show-Statements/SHOW-LOAD.md | 79 ++++++++++++ .../Show-Statements/SHOW-MIGRATIONS.md | 12 ++ .../Show-Statements/SHOW-PARTITION-ID.md | 17 +++ .../Show-Statements/SHOW-PARTITIONS.md | 41 ++++++ .../Show-Statements/SHOW-PLUGINS.md | 20 +++ .../Show-Statements/SHOW-PROCESSLIST.md | 30 +++++ .../Show-Statements/SHOW-PROPERTY.md | 4 +- .../Show-Statements/SHOW-REPOSITORIES.md | 29 +++++ .../Show-Statements/SHOW-RESOURCES.md | 46 +++++++ .../Show-Statements/SHOW-RESTORE.md | 46 +++++++ .../Show-Statements/SHOW-ROLES.md | 18 +++ .../Show-Statements/SHOW-ROUTINE-LOAD-TASK.md | 45 +++++++ .../Show-Statements/SHOW-ROUTINE-LOAD.md | 91 +++++++++++++ .../Show-Statements/SHOW-SMALL-FILES.md | 25 ++++ .../Show-Statements/SHOW-SNAPSHOT.md | 42 ++++++ .../Show-Statements/SHOW-STATUS.md | 88 ++++++++++++- .../Show-Statements/SHOW-STREAM-LOAD.md | 61 +++++++++ .../Show-Statements/SHOW-SYNC-JOB.md | 24 ++++ .../Show-Statements/SHOW-TABLE-ID.md | 18 +++ .../Show-Statements/SHOW-TABLE-STATUS.md | 29 +++++ .../Show-Statements/SHOW-TABLET.md | 18 +++ .../Show-Statements/SHOW-TRANSACTION.md | 68 ++++++++++ .../Show-Statements/SHOW-VARIABLES.md | 38 ++++++ .../Show-Statements/SHOW-VIEW.md | 18 +++ .../SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md | 120 ++++++++++++++++++ .../Show-Statements/SHOW-ALTER.md | 44 ++++++- .../Show-Statements/SHOW-BACKENDS.md | 25 ++++ .../Show-Statements/SHOW-BACKUP.md | 43 +++++++ .../Show-Statements/SHOW-BROKER.md | 19 +++ .../Show-Statements/SHOW-COLUMNS.md | 20 ++- .../Show-Statements/SHOW-CREATE-DATABASE.md | 4 + .../Show-Statements/SHOW-CREATE-FUNCTION.md | 23 ++++ .../SHOW-CREATE-ROUTINE-LOAD.md | 24 ++++ .../Show-Statements/SHOW-CREATE-TABLE.md | 23 ++++ .../Show-Statements/SHOW-DATA.md | 81 ++++++++++++ .../Show-Statements/SHOW-DATABASE-ID.md | 18 +++ .../Show-Statements/SHOW-DATABASES.md | 12 ++ .../Show-Statements/SHOW-DELETE.md | 18 +++ .../Show-Statements/SHOW-DYNAMIC-PARTITION.md | 18 +++ .../Show-Statements/SHOW-ENCRYPT-KEY.md | 37 ++++++ .../Show-Statements/SHOW-ENGINES.md | 4 + .../Show-Statements/SHOW-EVENTS.md | 4 + .../Show-Statements/SHOW-EXPORT.md | 58 ++++++++- .../Show-Statements/SHOW-FRONTENDS.md | 21 +++ .../Show-Statements/SHOW-FUNCTIONS.md | 55 ++++++++ .../Show-Statements/SHOW-GRANTS.md | 36 ++++++ .../Show-Statements/SHOW-INDEX.md | 20 +++ .../Show-Statements/SHOW-LAST-INSERT.md | 77 +++++++++++ .../Show-Statements/SHOW-LOAD.md | 79 ++++++++++++ .../Show-Statements/SHOW-MIGRATIONS.md | 12 ++ .../Show-Statements/SHOW-OPEN-TABLES.md | 12 ++ .../Show-Statements/SHOW-PARTITION-ID.md | 18 +++ .../Show-Statements/SHOW-PARTITIONS.md | 41 ++++++ .../Show-Statements/SHOW-PLUGINS.md | 20 +++ .../Show-Statements/SHOW-PROCESSLIST.md | 30 +++++ .../Show-Statements/SHOW-PROPERTY.md | 42 +++--- .../Show-Statements/SHOW-REPOSITORIES.md | 29 +++++ .../Show-Statements/SHOW-RESOURCES.md | 46 +++++++ .../Show-Statements/SHOW-RESTORE.md | 46 +++++++ .../Show-Statements/SHOW-ROLES.md | 18 +++ .../Show-Statements/SHOW-ROUTINE-LOAD-TASK.md | 42 ++++++ .../Show-Statements/SHOW-ROUTINE-LOAD.md | 91 +++++++++++++ .../Show-Statements/SHOW-SMALL-FILES.md | 25 ++++ .../Show-Statements/SHOW-SNAPSHOT.md | 41 ++++++ .../Show-Statements/SHOW-STATUS.md | 4 + .../Show-Statements/SHOW-STREAM-LOAD.md | 61 +++++++++ .../Show-Statements/SHOW-SYNC-JOB.md | 24 ++++ .../Show-Statements/SHOW-TABLE-ID.md | 18 +++ .../Show-Statements/SHOW-TABLE-STATUS.md | 29 +++++ .../Show-Statements/SHOW-TABLET.md | 18 +++ .../Show-Statements/SHOW-TRANSACTION.md | 68 ++++++++++ .../Show-Statements/SHOW-USER.md | 4 + .../Show-Statements/SHOW-VARIABLES.md | 38 ++++++ .../Show-Statements/SHOW-VIEW.md | 18 +++ 95 files changed, 3225 insertions(+), 27 deletions(-) create mode 100644 new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md create mode 100644 new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LAST-INSERT.md create mode 100644 new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md create mode 100644 new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-LAST-INSERT.md diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md index 93ee8dd89c..ce2184afc1 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md @@ -26,10 +26,50 @@ under the License. ## SHOW-ALTER +### Name + +SHOW ALTER + ### Description +This statement is used to display the execution of various modification tasks currently in progress + +```sql +SHOW ALTER [CLUSTER | TABLE [COLUMN | ROLLUP] [FROM db_name]]; +```` + +TABLE COLUMN: show ALTER tasks that modify columns + Support syntax [WHERE TableName|CreateTime|FinishTime|State] [ORDER BY] [LIMIT] + TABLE ROLLUP: Shows the task of creating or deleting a ROLLUP index + If db_name is not specified, the current default db is used + CLUSTER: Displays tasks related to cluster operations (only for administrators! To be implemented...) + ### Example +1. Display the task execution of all modified columns of the default db + + ```sql + SHOW ALTER TABLE COLUMN; + ```` + +2. Display the task execution status of the last modified column of a table + + ```sql + SHOW ALTER TABLE COLUMN WHERE TableName = "table1" ORDER BY CreateTime DESC LIMIT 1; + ```` + +3. Display the task execution of creating or deleting ROLLUP index for the specified db + + ```sql + SHOW ALTER TABLE ROLLUP FROM example_db; + ```` + +4. Show tasks related to cluster operations (only for administrators! To be implemented...) + + ```` + SHOW ALTER CLUSTER; + ```` + ### Keywords SHOW, ALTER diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKENDS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKENDS.md index 3c86aaaa7f..72b1850921 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKENDS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKENDS.md @@ -26,8 +26,33 @@ under the License. ## SHOW-BACKENDS +### Name + +SHOW BACKENDS + ### Description +This statement is used to view the BE nodes in the cluster + +```sql + SHOW BACKENDS; +```` + +illustrate: + + 1. LastStartTime indicates the last BE start time. + 2. LastHeartbeat indicates the last heartbeat. + 3. Alive indicates whether the node is alive or not. + 4. If SystemDecommissioned is true, it means that the node is being safely decommissioned. + 5. If ClusterDecommissioned is true, it means that the node is going offline in the current cluster. + 6. TabletNum represents the number of shards on the node. + 7. DataUsedCapacity Indicates the space occupied by the actual user data. + 8. AvailCapacity Indicates the available space on the disk. + 9. TotalCapacity represents the total disk space. TotalCapacity = AvailCapacity + DataUsedCapacity + other non-user data files occupy space. + 10. UsedPct Indicates the percentage of disk used. + 11. ErrMsg is used to display the error message when the heartbeat fails. + 12. Status is used to display some status information of BE in JSON format, including the time information of the last time BE reported its tablet. + ### Example ### Keywords diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKUP.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKUP.md index b8583ee74b..72c4512656 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKUP.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BACKUP.md @@ -26,10 +26,53 @@ under the License. ## SHOW-BACKUP +### Name + +SHOW BACKUP + ### Description +This statement is used to view BACKUP tasks + +grammar: + +```sql + SHOW BACKUP [FROM db_name] +```` + +illustrate: + +1. Only the most recent BACKUP task is saved in Doris. +1. The meaning of each column is as follows: + JobId: Unique job id + SnapshotName: The name of the backup + DbName: belongs to the database + State: current stage + PENDING: The initial state after submitting the job + SNAPSHOTING: Executing snapshot + UPLOAD_SNAPSHOT: Snapshot completed, ready to upload + UPLOADING: Snapshot uploading + SAVE_META: Save job meta information to a local file + UPLOAD_INFO: Upload job meta information + FINISHED: The job was successful + CANCELLED: Job failed + BackupObjs: Backed up tables and partitions + CreateTime: task submission time + SnapshotFinishedTime: Snapshot completion time + UploadFinishedTime: Snapshot upload completion time + FinishedTime: Job finish time + UnfinishedTasks: Displays unfinished subtask ids during SNAPSHOTING and UPLOADING stages + Status: If the job fails, display the failure message + Timeout: Job timeout, in seconds + ### Example +1. View the last BACKUP task under example_db. + + ```sql + SHOW BACKUP FROM example_db; + ```` + ### Keywords SHOW, BACKUP diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BROKER.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BROKER.md index 4fe3a7f5c6..b34634c4d6 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BROKER.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-BROKER.md @@ -26,8 +26,27 @@ under the License. ## SHOW-BROKER +### Name + +SHOW BROKER + ### Description +This statement is used to view the currently existing broker + +grammar: + +```sql +SHOW BROKER; +```` + +illustrate: + +1. LastStartTime indicates the last BE start time. +2. LastHeartbeat indicates the last heartbeat. +3. Alive indicates whether the node is alive or not. +4. ErrMsg is used to display the error message when the heartbeat fails. + ### Example ### Keywords diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-COLUMNS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-COLUMNS.md index f9ad64cf52..bbf700f1db 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-COLUMNS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-COLUMNS.md @@ -26,10 +26,28 @@ under the License. ## SHOW-COLUMNS +### Name + +SHOW FULL COLUMNS + ### Description +This statement is used to specify the column information of the table + +grammar: + +```sql +SHOW FULL COLUMNS FROM tbl; +``` + ### Example +1. View the column information of the specified table + + ```sql + SHOW FULL COLUMNS FROM tbl; + ```` + ### Keywords SHOW, COLUMNS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-FUNCTION.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-FUNCTION.md index 3ebe2b8234..c5e80c03ae 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-FUNCTION.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-FUNCTION.md @@ -26,10 +26,34 @@ under the License. ## SHOW-CREATE-FUNCTION +### Name + +SHOW CREATE FUNTION + ### Description +This statement is used to display the creation statement of the user-defined function + +grammar: + +```sql +SHOW CREATE FUNTION function_name(arg_type [, ...]) [FROM db_name]]; +```` + +illustrate: + +1. `function_name`: The name of the function to display +2. `arg_type`: The parameter list of the function to display +3. If db_name is not specified, the current default db is used + ### Example +1. Show the creation statement of the specified function under the default db + + ```sql + SHOW CREATE FUNCTION my_add(INT, INT) + ```` + ### Keywords SHOW, CREATE, FUNCTION diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-ROUTINE-LOAD.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-ROUTINE-LOAD.md index 8a0200b7c4..4ee02386f2 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-ROUTINE-LOAD.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-ROUTINE-LOAD.md @@ -26,10 +26,35 @@ under the License. ## SHOW-CREATE-ROUTINE-LOAD +### Name + +SHOW CREATE ROUTINE LOAD + ### Description +This statement is used to demonstrate the creation statement of a routine import job. + +The kafka partition and offset in the result show the currently consumed partition and the corresponding offset to be consumed. + +grammar: + +```sql +SHOW [ALL] CREATE ROUTINE LOAD for load_name; +```` + +illustrate: + +1. `ALL`: optional parameter, which means to get all jobs, including historical jobs +2. `load_name`: routine import job name + ### Example +1. Show the creation statement of the specified routine import job under the default db + + ```sql + SHOW CREATE ROUTINE LOAD for test_load + ```` + ### Keywords SHOW, CREATE, ROUTINE, LOAD diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-TABLE.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-TABLE.md index 67587b102a..29e24ad888 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-TABLE.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-CREATE-TABLE.md @@ -26,10 +26,33 @@ under the License. ## SHOW-CREATE-TABLE +### Name + +SHOW CREATE TABLE + ### Description +This statement is used to display the creation statement of the data table. + +grammar: + +```sql +SHOW CREATE TABLE [DBNAME.]TABLE_NAME +```` + +illustrate: + +1. `DBNAMNE` : database name +2. `TABLE_NAME` : table name + ### Example +1. View the table creation statement of a table + + ```sql + SHOW CREATE TABLE demo.tb1 + ```` + ### Keywords SHOW, CREATE, TABLE diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATA.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATA.md index cf03a8c76e..d3faa24757 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATA.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATA.md @@ -26,10 +26,91 @@ under the License. ## SHOW-DATA +### Name + +SHOW DATA + ### Description +This statement is used to display the amount of data, the number of replicas, and the number of statistical rows. + +grammar: + +```sql +SHOW DATA [FROM db_name[.table_name]] [ORDER BY ...]; +```` + +illustrate: + +1. If the FROM clause is not specified, the data volume and number of replicas subdivided into each table under the current db will be displayed. The data volume is the total data volume of all replicas. The number of replicas is the number of replicas for all partitions of the table and all materialized views. + +2. If the FROM clause is specified, the data volume, number of copies and number of statistical rows subdivided into each materialized view under the table will be displayed. The data volume is the total data volume of all replicas. The number of replicas is the number of replicas for all partitions of the corresponding materialized view. The number of statistical rows is the number of statistical rows for all partitions of the corresponding materialized view. + +3. When counting the number of rows, the one with the largest number of rows among the multiple copies shall prevail. + +4. The `Total` row in the result set represents the total row. The `Quota` line represents the quota set by the current database. The `Left` line indicates the remaining quota. + +5. If you want to see the size of each Partition, see `help show partitions`. + +6. You can use ORDER BY to sort on any combination of columns. + ### Example +1. Display the data volume, replica number, aggregate data volume and aggregate replica number of each table in the default db. + + ```sql + SHOW DATA; + ```` + + ```` + +-----------+-------------+--------------+ + | TableName | Size | ReplicaCount | + +-----------+-------------+--------------+ + | tbl1 | 900.000 B | 6 | + | tbl2 | 500.000 B | 3 | + | Total | 1.400 KB | 9 | + | Quota | 1024.000 GB | 1073741824 | + | Left | 1021.921 GB | 1073741815 | + +-----------+-------------+--------------+ + ```` + +2. Display the subdivided data volume, the number of replicas and the number of statistical rows of the specified table under the specified db + + ```sql + SHOW DATA FROM example_db.test; + ```` + + ```` + +-----------+-----------+-----------+--------------+----------+ + | TableName | IndexName | Size | ReplicaCount | RowCount | + +-----------+-----------+-----------+--------------+----------+ + | test | r1 | 10.000MB | 30 | 10000 | + | | r2 | 20.000MB | 30 | 20000 | + | | test2 | 50.000MB | 30 | 50000 | + | | Total | 80.000 | 90 | | + +-----------+-----------+-----------+--------------+----------+ + ```` + +3. It can be combined and sorted according to the amount of data, the number of copies, the number of statistical rows, etc. + + ```sql + SHOW DATA ORDER BY ReplicaCount desc,Size asc; + ```` + + ```` + +-----------+-------------+--------------+ + | TableName | Size | ReplicaCount | + +-----------+-------------+--------------+ + | table_c | 3.102 KB | 40 | + | table_d | .000 | 20 | + | table_b | 324.000 B | 20 | + | table_a | 1.266 KB | 10 | + | Total | 4.684 KB | 90 | + | Quota | 1024.000 GB | 1073741824 | + | Left | 1024.000 GB | 1073741734 | + +-----------+-------------+--------------+ + ```` + ### Keywords SHOW, DATA diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASE-ID.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASE-ID.md index 2279b4de52..b87ea1c90c 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASE-ID.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASE-ID.md @@ -26,10 +26,28 @@ under the License. ## SHOW-DATABASE-ID +### Name + +SHOW DATABASE ID + ### Description +This statement is used to find the corresponding database name according to the database id (only for administrators) + +grammar: + +```sql +SHOW DATABASE [database_id] +```` + ### Example +1. Find the corresponding database name according to the database id + + ```sql + SHOW DATABASE 1001; + ```` + ### Keywords SHOW, DATABASE, ID diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASES.md index 1e8f6705da..e8461e1fd4 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DATABASES.md @@ -26,8 +26,20 @@ under the License. ## SHOW-DATABASES +### Name + +SHOW DATABASES + ### Description +This statement is used to display the currently visible db + +grammar: + +```sql +SHOW DATABASES; +```` + ### Example ### Keywords diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DELETE.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DELETE.md index cdae222606..334d5104b7 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DELETE.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DELETE.md @@ -26,10 +26,28 @@ under the License. ## SHOW-DELETE +### Name + +SHOW DELETE + ### Description +This statement is used to display the historical delete tasks that have been successfully executed + +grammar: + +```sql +SHOW DELETE [FROM db_name] +```` + ### Example + 1. Display all historical delete tasks of database database + + ```sql + SHOW DELETE FROM database; + ```` + ### Keywords SHOW, DELETE diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DYNAMIC-PARTITION.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DYNAMIC-PARTITION.md index 2fccdba2d1..128fe951c6 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DYNAMIC-PARTITION.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-DYNAMIC-PARTITION.md @@ -26,10 +26,28 @@ under the License. ## SHOW-DYNAMIC-PARTITION +### Name + +SHOW DYNAMIC + ### Description +This statement is used to display the status of all dynamic partition tables under the current db + +grammar: + +```sql +SHOW DYNAMIC PARTITION TABLES [FROM db_name]; +```` + ### Example + 1. Display all dynamic partition table status of database database + + ```sql + SHOW DYNAMIC PARTITION TABLES FROM database; + ```` + ### Keywords SHOW, DYNAMIC, PARTITION diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ENCRYPT-KEY.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ENCRYPT-KEY.md index f45ab611c3..9f38e153b2 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ENCRYPT-KEY.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ENCRYPT-KEY.md @@ -26,10 +26,47 @@ under the License. ## SHOW-ENCRYPT-KEY +### Name + +SHOW ENCRYPTKEYS + ### Description +View all custom keys under the database. If the user specifies a database, check the corresponding database, otherwise directly query the database where the current session is located. + +Requires `ADMIN` privilege on this database + +grammar: + +```sql +SHOW ENCRYPTKEYS [IN|FROM db] [LIKE 'key_pattern'] +```` + +parameter + +>`db`: database name to query +>`key_pattern`: parameter used to filter key names + ### Example + ```sql + mysql> SHOW ENCRYPTKEYS; + +-------------------+-------------------+ + | EncryptKey Name | EncryptKey String | + +-------------------+-------------------+ + | example_db.my_key | ABCD123456789 | + +-------------------+-------------------+ + 1 row in set (0.00 sec) + + mysql> SHOW ENCRYPTKEYS FROM example_db LIKE "%my%"; + +-------------------+-------------------+ + | EncryptKey Name | EncryptKey String | + +-------------------+-------------------+ + | example_db.my_key | ABCD123456789 | + +-------------------+-------------------+ + 1 row in set (0.00 sec) + ```` + ### Keywords SHOW, ENCRYPT, KEY diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-EXPORT.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-EXPORT.md index fab358e3f7..d4022e0a4b 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-EXPORT.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-EXPORT.md @@ -26,10 +26,67 @@ under the License. ## SHOW-EXPORT +### Name + +SHOW EXPORT + ### Description +This statement is used to display the execution of the specified export task + +grammar: + +```sql +SHOW EXPORT +[FROM db_name] + [ + WHERE + [ID=your_job_id] + [STATE = ["PENDING"|"EXPORTING"|"FINISHED"|"CANCELLED"]] + [LABEL=your_label] + ] +[ORDER BY...] +[LIMIT limit]; +```` + +illustrate: + 1. If db_name is not specified, the current default db is used + 2. If STATE is specified, matches EXPORT state + 3. You can use ORDER BY to sort any combination of columns + 4. If LIMIT is specified, limit matching records are displayed. Otherwise show all + ### Example +1. Show all export tasks of default db + + ```sql + SHOW EXPORT; + ```` + +2. Display the export tasks of the specified db, sorted by StartTime in descending order + + ```sql + SHOW EXPORT FROM example_db ORDER BY StartTime DESC; + ```` + +3. Display the export tasks of the specified db, the state is "exporting", and sort by StartTime in descending order + + ```sql + SHOW EXPORT FROM example_db WHERE STATE = "exporting" ORDER BY StartTime DESC; + ```` + +4. Display the export task of the specified db and specified job_id + + ```sql + SHOW EXPORT FROM example_db WHERE ID = job_id; + ```` + +5. Display the specified db and specify the export task of the label + + ```sql + SHOW EXPORT FROM example_db WHERE LABEL = "mylabel"; + ```` + ### Keywords SHOW, EXPORT diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FRONTENDS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FRONTENDS.md index a946cd3230..4ee4fbc5e8 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FRONTENDS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FRONTENDS.md @@ -26,8 +26,30 @@ under the License. ## SHOW-FRONTENDS +### Name + +SHOW FRONTENDS + ### Description +This statement is used to view FE nodes + + grammar: + +```sql +SHOW FRONTENDS; +```` + +illustrate: + +1. name indicates the name of the FE node in bdbje. +2. If Join is true, it means that the node has joined the cluster before. But it does not mean that it is still in the cluster (may have lost contact +3. Alive indicates whether the node is alive or not. +4. ReplayedJournalId indicates the maximum metadata journal id that has been replayed by the node. +5. LastHeartbeat is the last heartbeat. +6. IsHelper indicates whether the node is a helper node in bdbje. +7. ErrMsg is used to display the error message when the heartbeat fails. + ### Example ### Keywords diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FUNCTIONS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FUNCTIONS.md index 82f2dd7f8d..5602ec09ae 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FUNCTIONS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-FUNCTIONS.md @@ -26,10 +26,65 @@ under the License. ## SHOW-FUNCTIONS +### Name + +SHOW FUNCTIONS + ### Description +View all custom (system-provided) functions under the database. If the user specifies a database, then view the corresponding database, otherwise directly query the database where the current session is located + +Requires `SHOW` permission on this database + +grammar + +```sql +SHOW [FULL] [BUILTIN] FUNCTIONS [IN|FROM db] [LIKE 'function_pattern'] +```` + + Parameters + +>`full`: Indicates the detailed information of the display function +>`builtin`: Indicates the functions provided by the display system +>`db`: database name to query +>`function_pattern`: parameter used to filter function names + ### Example +````sql +mysql> show full functions in testDb\G +**************************** 1. row ******************** ****** + Signature: my_add(INT,INT) + Return Type: INT + Function Type: Scalar +Intermediate Type: NULL + Properties: {"symbol":"_ZN9doris_udf6AddUdfEPNS_15FunctionContextERKNS_6IntValES4_","object_file":"http://host:port/libudfsample.so","md5":"cfe7a362d10f3aaf6c49974ee0f1f878"} +**************************** 2. row ******************** ****** + Signature: my_count(BIGINT) + Return Type: BIGINT + Function Type: Aggregate +Intermediate Type: NULL + Properties: { "object_file": "http: // host: port / libudasample.so", "finalize_fn": "_ZN9doris_udf13CountFinalizeEPNS_15FunctionContextERKNS_9BigIntValE", "init_fn": "_ZN9doris_udf9CountInitEPNS_15FunctionContextEPNS_9BigIntValE", "merge_fn": "_ZN9doris_udf10CountMergeEPNS_15FunctionContextERKNS_9BigIntValEPS2_", "md5": " 37d185f80f95569e2676da3d5b5b9d2f","update_fn":"_ZN9doris_udf11CountUpdateEPNS_15FunctionContextERKNS_6IntValEPNS_9BigIntValE"} +**************************** 3. row ******************** ****** + Signature: id_masking(BIGINT) + Return Type: VARCHAR + Function Type: Alias +Intermediate Type: NULL + Properties: {"parameter":"id","origin_function":"concat(left(`id`, 3), `****`, right(`id`, 4))"} + +3 rows in set (0.00 sec) +mysql> show builtin functions in testDb like 'year%'; ++---------------+ +| Function Name | ++---------------+ +| year | +| years_add | +| years_diff | +| years_sub | ++---------------+ +2 rows in set (0.00 sec) +```` + ### Keywords SHOW, FUNCTIONS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-GRANTS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-GRANTS.md index 3bee8512c1..ae04952d60 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-GRANTS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-GRANTS.md @@ -26,10 +26,46 @@ under the License. ## SHOW-GRANTS +### Name + +SHOW GRANTS + ### Description + This statement is used to view user permissions. + +grammar: + +```sql +SHOW [ALL] GRANTS [FOR user_identity]; +``` + +illustrate: + +1. SHOW ALL GRANTS can view the permissions of all users. +2. If user_identity is specified, view the permissions of the specified user. And the user_identity must be created by the CREATE USER command. +3. If user_identity is not specified, view the permissions of the current user. + ### Example +1. View all user permission information + + ```sql + SHOW ALL GRANTS; + ```` + +2. View the permissions of the specified user + + ```sql + SHOW GRANTS FOR jack@'%'; + ```` + +3. View the permissions of the current user + + ```sql + SHOW GRANTS; + ```` + ### Keywords SHOW, GRANTS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-INDEX.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-INDEX.md index 9b4f239fcf..cf9d405260 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-INDEX.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-INDEX.md @@ -26,10 +26,30 @@ under the License. ## SHOW-INDEX +### Name + +SHOW INDEX + ### Description + This statement is used to display information about indexes in a table. Currently, only bitmap indexes are supported. + +grammar: + +````SQL +SHOW INDEX[ES] FROM [db_name.]table_name [FROM database]; +or +SHOW KEY[S] FROM [db_name.]table_name [FROM database]; +```` + ### Example + 1. Display the lower index of the specified table_name + + ````SQL + SHOW INDEX FROM example_db.table_name; + ```` + ### Keywords SHOW, INDEX diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LAST-INSERT.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LAST-INSERT.md new file mode 100644 index 0000000000..e226619d79 --- /dev/null +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LAST-INSERT.md @@ -0,0 +1,76 @@ +--- +{ + "title": "SHOW-LAST-INSERT", + "language": "en" +} + +--- + + + +## SHOW-LAST-INSERT + +### Name + +SHOW LAST INSERT + +### Description + +This syntax is used to view the result of the latest insert operation in the current session connection + +grammar: + +```sql +SHOW LAST INSERT +```` + +Example of returned result: + +```` + TransactionId: 64067 + Label: insert_ba8f33aea9544866-8ed77e2844d0cc9b + Database: default_cluster:db1 + Table: t1 +TransactionStatus: VISIBLE + LoadedRows: 2 + FilteredRows: 0 +```` + +illustrate: + +* TransactionId: transaction id +* Label: the label corresponding to the insert task +* Database: the database corresponding to insert +* Table: the table corresponding to insert +* TransactionStatus: transaction status + * PREPARE: preparation stage + * PRECOMMITTED: Pre-commit stage + * COMMITTED: The transaction succeeded, but the data was not visible + * VISIBLE: The transaction succeeded and the data is visible + * ABORTED: Transaction failed +* LoadedRows: Number of imported rows +* FilteredRows: The number of rows being filtered + +### Example + + SHOW, LASR ,INSERT + +### Best Practice + diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md index 06b5897243..38ed9908d6 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md @@ -26,10 +26,89 @@ under the License. ## SHOW-LOAD +### Name + +SHOW LOAD + ### Description +This statement is used to display the execution of the specified import task + +grammar: + +```sql +SHOW LOAD +[FROM db_name] +[ + WHERE + [LABEL [ = "your_label" | LIKE "label_matcher"]] + [STATE = ["PENDING"|"ETL"|"LOADING"|"FINISHED"|"CANCELLED"|]] +] +[ORDER BY...] +[LIMIT limit][OFFSET offset]; +```` + +illustrate: + +1. If db_name is not specified, the current default db is used + +2. If LABEL LIKE is used, it will match import tasks whose label contains label_matcher + +3. If LABEL = is used, it will match the specified label exactly + +4. If STATE is specified, matches the LOAD state + +5. You can use ORDER BY to sort on any combination of columns + +6. If LIMIT is specified, limit matching records are displayed. Otherwise show all + +7. If OFFSET is specified, the query results are displayed starting at offset offset. By default the offset is 0. + +8. If you are using broker/mini load, the connections in the URL column can be viewed using the following command: + + ```sql + SHOW LOAD WARNINGS ON 'url' + ```` + ### Example +1. Show all import tasks for default db + + ```sql + SHOW LOAD; + ```` + +2. Display the import tasks of the specified db, the label contains the string "2014_01_02", and display the oldest 10 + + ```sql + SHOW LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10; + ```` + +3. Display the import tasks of the specified db, specify the label as "load_example_db_20140102" and sort by LoadStartTime in descending order + + ```sql + SHOW LOAD FROM example_db WHERE LABEL = "load_example_db_20140102" ORDER BY LoadStartTime DESC; + ```` + +4. Display the import task of the specified db, specify the label as "load_example_db_20140102", the state as "loading", and sort by LoadStartTime in descending order + + ```sql + SHOW LOAD FROM example_db WHERE LABEL = "load_example_db_20140102" AND STATE = "loading" ORDER BY LoadStartTime DESC; + ```` + +5. Display the import tasks of the specified db and sort them in descending order by LoadStartTime, and display 10 query results starting from offset 5 + + ```sql + SHOW LOAD FROM example_db ORDER BY LoadStartTime DESC limit 5,10; + SHOW LOAD FROM example_db ORDER BY LoadStartTime DESC limit 10 offset 5; + ```` + +6. Small batch import is a command to check the import status + + ```` + curl --location-trusted -u {user}:{passwd} http://{hostname}:{port}/api/{database}/_load_info?label={labelname} + ```` + ### Keywords SHOW, LOAD diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md index 4d32fd4c0f..5c048894f0 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md @@ -26,8 +26,20 @@ under the License. ## SHOW-MIGRATIONS +### Name + +SHOW MIGRATIONS + ### Description +This statement is used to view the progress of database migration + +grammar: + +```sql +SHOW MIGRATIONS +```` + ### Example ### Keywords diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md index 3fd215f958..4c11df11ed 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md @@ -26,10 +26,27 @@ under the License. ## SHOW-PARTITION-ID +### Name + +SHOW PARTITION ID + ### Description +This statement is used to find the corresponding database name, table name, partition name according to the partition id (only for administrators) + + grammar: + +```sql +SHOW PARTITION [partition_id] +``` ### Example +1. Find the corresponding database name, table name, partition name according to the partition id + + ```sql + SHOW PARTITION 10002; + ```` + ### Keywords SHOW, PARTITION, ID diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md index d5b0695463..d382ea1173 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md @@ -26,10 +26,51 @@ under the License. ## SHOW-PARTITIONS +### Name + +SHOW PARTITIONS + ### Description + This statement is used to display partition information + +grammar: + +````SQL + SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT]; +```` + +illustrate: + +1. Support the filtering of PartitionId, PartitionName, State, Buckets, ReplicationNum, LastConsistencyCheckTime and other columns +2. TEMPORARY specifies to list temporary partitions + ### Example +1. Display all non-temporary partition information of the specified table under the specified db + +````SQL + SHOW PARTITIONS FROM example_db.table_name; +```` + +2. Display all temporary partition information of the specified table under the specified db + + ````SQL + SHOW TEMPORARY PARTITIONS FROM example_db.table_name; + ```` + +3. Display the information of the specified non-temporary partition of the specified table under the specified db + + ````SQL + SHOW PARTITIONS FROM example_db.table_name WHERE PartitionName = "p1"; + ```` + +4. Display the latest non-temporary partition information of the specified table under the specified db + + ````SQL + SHOW PARTITIONS FROM example_db.table_name ORDER BY PartitionId DESC LIMIT 1; + ```` + ### Keywords SHOW, PARTITIONS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md index d96ce805fd..4c7890f6ed 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md @@ -26,10 +26,30 @@ under the License. ## SHOW-PLUGINS +### Name + +SHOW PLUGINS + ### Description +This statement is used to display installed plugins + +grammar: + +````SQL +SHOW PLUGINS +```` + +This command will display all user-installed and system built-in plugins + ### Example +1. Show installed plugins: + + ````SQL + SHOW PLUGINS; + ```` + ### Keywords SHOW, PLUGINS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md index c587c732c9..8f4fc67c79 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md @@ -26,10 +26,40 @@ under the License. ## SHOW-PROCESSLIST +### Name + +SHOW PROCESSLIST + ### Description +Display the running threads of the user. It should be noted that except the root user who can see all running threads, other users can only see their own running threads, and cannot see the running threads of other users. + +grammar: + +```sql +SHOW [FULL] PROCESSLIST +```` + +illustrate: + +- Id: It is the unique identifier of this thread. When we find that there is a problem with this thread, we can use the kill command to add this Id value to kill this thread. Earlier we said that the information displayed by show processlist comes from the information_schema.processlist table, so this Id is the primary key of this table. +- User: refers to the user who started this thread. +- Host: Records the IP and port number of the client sending the request. Through this information, when troubleshooting the problem, we can locate which client and which process sent the request. +- Cluster: Cluster name +- DB: which database the currently executed command is on. If no database is specified, the value is NULL . +- Command: refers to the command that the thread is executing at the moment. This is very complicated, and is explained separately below +- Time: Indicates the time the thread is in the current state. +- State: The state of the thread, corresponding to Command, explained separately below. +- Info: Generally recorded is the statement executed by the thread. By default, only the first 100 characters are displayed, that is, the statement you see may be truncated. To see all the information, you need to use show full processlist. + ### Example +1. View the threads running by the current user + + ````SQL + SHOW PROCESSLIST + ```` + ### Keywords SHOW, PROCESSLIST diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md index a89000dedf..e61c972888 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md @@ -47,9 +47,9 @@ Return result description: ```sql mysql> show property like'%connection%'; +----------------------+-------+ -| Key | Value | +| Key | Value | +----------------------+-------+ -| max_user_connections | 100 | +| max_user_connections | 100 | +----------------------+-------+ 1 row in set (0.01 sec) ``` diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md index d037fe4800..52d652af6a 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md @@ -26,10 +26,39 @@ under the License. ## SHOW-REPOSITORIES +### Name + +SHOW REPOSITORIES + ### Description +This statement is used to view the currently created warehouse + +grammar: + +```sql +SHOW REPOSITORIES; +```` + +illustrate: + +1. The meanings of the columns are as follows: + RepoId: Unique repository ID + RepoName: repository name + CreateTime: The time when the repository was first created + IsReadOnly: Whether it is a read-only repository + Location: The root directory in the warehouse for backing up data + Broker: Dependent Broker + ErrMsg: Doris will regularly check the connectivity of the warehouse, if there is a problem, an error message will be displayed here + ### Example +1. View the created repository: + +```sql + SHOW REPOSITORIES; +```` + ### Keywords SHOW, REPOSITORIES diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md index 68d642ccc8..7722cae831 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md @@ -26,10 +26,56 @@ under the License. ## SHOW-RESOURCES +### Name + +SHOW RESOURCES + ### Description +This statement is used to display resources that the user has permission to use. Ordinary users can only display resources with permission, and root or admin users will display all resources. + +grammar: + +```sql +SHOW RESOURCES +[ + WHERE + [NAME [ = "your_resource_name" | LIKE "name_matcher"]] + [RESOURCETYPE = ["SPARK"]] +] +[ORDER BY...] +[LIMIT limit][OFFSET offset]; +```` + +illustrate: + +1. If NAME LIKE is used, it will match Resource whose Name contains name_matcher in RESOURCES +2. If NAME = is used, it will match the specified Name exactly +3. If RESOURCETYPE is specified, match the corresponding Resrouce type +4. You can use ORDER BY to sort on any combination of columns +5. If LIMIT is specified, limit matching records are displayed. Otherwise show all +6. If OFFSET is specified, the query results are displayed starting at offset offset. By default the offset is 0. + ### Example +1. Display all resources that the current user has permissions to + + ```sql + SHOW RESOURCES; + ```` + +1. Display the specified Resource, the name contains the string "20140102", and display 10 attributes + + ```sql + SHOW RESOURCES WHERE NAME LIKE "2014_01_02" LIMIT 10; + ```` + +1. Display the specified Resource, specify the name as "20140102" and sort by KEY in descending order + + ```sql + SHOW RESOURCES WHERE NAME = "20140102" ORDER BY `KEY` DESC; + ```` + ### Keywords SHOW, RESOURCES diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md index 5d5f631c3c..eb31e01866 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md @@ -26,10 +26,56 @@ under the License. ## SHOW-RESTORE +### Name + +SHOW RESTORE + ### Description +This statement is used to view RESTORE tasks + +grammar: + +````SQL +SHOW RESTORE [FROM DB_NAME] +```` + +illustrate: + 1. Only the most recent RESTORE task is saved in Doris. + 2. The meaning of each column is as follows: + JobId: Unique job id + Label: The name of the backup to restore + Timestamp: The time version of the backup to restore + DbName: belongs to the database + State: current stage + PENDING: The initial state after submitting the job + SNAPSHOTING: Executing snapshot + DOWNLOAD: The snapshot is complete, ready to download the snapshot in the repository + DOWNLOADING: Snapshot downloading + COMMIT: Snapshot download is complete, ready to take effect + COMMITING: in effect + FINISHED: The job was successful + CANCELLED: Job failed + AllowLoad: Whether to allow import when restoring (currently not supported) + ReplicationNum: Specifies the number of replicas to restore + RestoreJobs: Tables and partitions to restore + CreateTime: task submission time + MetaPreparedTime: Metadata preparation completion time + SnapshotFinishedTime: Snapshot completion time + DownloadFinishedTime: Snapshot download completion time + FinishedTime: Job finish time + UnfinishedTasks: Displays unfinished subtask ids during SNAPSHOTING, DOWNLOADING and COMMITING stages + Status: If the job fails, display the failure message + Timeout: Job timeout, in seconds + ### Example +1. View the latest RESTORE task under example_db. + + ```sql + SHOW RESTORE FROM example_db; + ```` + ### Keywords SHOW, RESTORE diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md index e982e89eb0..33177e86ff 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md @@ -26,10 +26,28 @@ under the License. ## SHOW-ROLES +### Name + +SHOW ROLES + ### Description +This statement is used to display all created role information, including role name, included users and permissions. + +grammar: + +````SQL +SHOW ROLES +```` + ### Example +1. View created roles + + ````SQL + SHOW ROLES + ```` + ### Keywords SHOW, ROLES diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md index 481c8ecd63..359f5018fb 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md @@ -26,13 +26,58 @@ under the License. ## SHOW-ROUTINE-LOAD-TASK +### Name + +SHOW ROUTINE LOAD TASK + ### Description +View the currently running subtasks of a specified Routine Load job. + + + +```sql +SHOW ROUTINE LOAD TASK +WHERE JobName = "job_name"; +```` + +The returned results are as follows: + +````text + TaskId: d67ce537f1be4b86-abf47530b79ab8e6 + TxnId: 4 + TxnStatus: UNKNOWN + JobId: 10280 + CreateTime: 2020-12-12 20:29:48 + ExecuteStartTime: 2020-12-12 20:29:48 + Timeout: 20 + BeId: 10002 +DataSourceProperties: {"0":19} +```` + +- `TaskId`: The unique ID of the subtask. +- `TxnId`: The import transaction ID corresponding to the subtask. +- `TxnStatus`: The import transaction status corresponding to the subtask. Usually UNKNOWN. No real meaning. +- `JobId`: The job ID corresponding to the subtask. +- `CreateTime`: The creation time of the subtask. +- `ExecuteStartTime`: The time when the subtask is scheduled to be executed, usually later than the creation time. +- `Timeout`: Subtask timeout, usually twice the `MaxIntervalS` set by the job. +- `BeId`: The ID of the BE node executing this subtask. +- `DataSourceProperties`: The starting offset of the Kafka Partition that the subtask is ready to consume. is a Json format string. Key is Partition Id. Value is the starting offset of consumption. + ### Example +1. Display the subtask information of the routine import task named test1. + + ```sql + SHOW ROUTINE LOAD TASK WHERE JobName = "test1"; + ```` + ### Keywords SHOW, ROUTINE, LOAD, TASK ### Best Practice +With this command, you can view how many subtasks are currently running in a Routine Load job, and which BE node is running on. + diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md index fe0ab3a1c5..fe4ba87f31 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md @@ -26,10 +26,101 @@ under the License. ## SHOW-ROUTINE-LOAD +### Name + +SHOW ROUTINE LOAD + ### Description +This statement is used to display the running status of the Routine Load job + +grammar: + +```sql +SHOW [ALL] ROUTINE LOAD [FOR jobName]; +```` + +Result description: + +```` + Id: job ID + Name: job name + CreateTime: job creation time + PauseTime: The last job pause time + EndTime: Job end time + DbName: corresponding database name + TableName: corresponding table name + State: job running state + DataSourceType: Data source type: KAFKA + CurrentTaskNum: The current number of subtasks + JobProperties: Job configuration details +DataSourceProperties: Data source configuration details + CustomProperties: custom configuration + Statistic: Job running status statistics + Progress: job running progress + Lag: job delay status +ReasonOfStateChanged: The reason for the job state change + ErrorLogUrls: The viewing address of the filtered unqualified data + OtherMsg: other error messages +```` + +* State + + There are the following 4 states: + * NEED_SCHEDULE: The job is waiting to be scheduled + * RUNNING: The job is running + * PAUSED: The job is paused + * STOPPED: The job has ended + * CANCELLED: The job was canceled + +* Progress + + For Kafka data sources, displays the currently consumed offset for each partition. For example, {"0":"2"} indicates that the consumption progress of Kafka partition 0 is 2. + +*Lag + + For Kafka data sources, shows the consumption latency of each partition. For example, {"0":10} means that the consumption delay of Kafka partition 0 is 10. + ### Example +1. Show all routine import jobs named test1 (including stopped or canceled jobs). The result is one or more lines. + + ```sql + SHOW ALL ROUTINE LOAD FOR test1; + ```` + +2. Show the currently running routine import job named test1 + + ```sql + SHOW ROUTINE LOAD FOR test1; + ```` + +3. Display all routine import jobs (including stopped or canceled jobs) under example_db. The result is one or more lines. + + ```sql + use example_db; + SHOW ALL ROUTINE LOAD; + ```` + +4. Display all running routine import jobs under example_db + + ```sql + use example_db; + SHOW ROUTINE LOAD; + ```` + +5. Display the currently running routine import job named test1 under example_db + + ```sql + SHOW ROUTINE LOAD FOR example_db.test1; + ```` + +6. Displays all routine import jobs named test1 under example_db (including stopped or canceled jobs). The result is one or more lines. + + ```sql + SHOW ALL ROUTINE LOAD FOR example_db.test1; + ```` + ### Keywords SHOW, ROUTINE, LOAD diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md index 214c108aec..82778d39dd 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md @@ -26,10 +26,35 @@ under the License. ## SHOW-SMALL-FILES +### Name + +SHOW FILE + ### Description +This statement is used to display files created by the CREATE FILE command within a database. + +```sql +SHOW FILE [FROM database]; +```` + +Return result description: + +- FileId: file ID, globally unique +- DbName: the name of the database to which it belongs +- Catalog: Custom Category +- FileName: file name +- FileSize: file size in bytes +- MD5: MD5 of the file + ### Example +1. View the uploaded files in the database my_database + + ```sql + SHOW FILE FROM my_database; + ```` + ### Keywords SHOW, SMALL, FILES diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md index 048daac9be..a2e20466d8 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md @@ -26,10 +26,52 @@ under the License. ## SHOW-SNAPSHOT +### Name + +SHOW SNAPSHOT + ### Description +This statement is used to view backups that already exist in the repository. + +grammar: + +```sql +SHOW SNAPSHOT ON `repo_name` +[WHERE SNAPSHOT = "snapshot" [AND TIMESTAMP = "backup_timestamp"]]; +```` + +illustrate: + +1. The meanings of the columns are as follows: + Snapshot: The name of the backup + Timestamp: corresponds to the time version of the backup + Status: If the backup is normal, it will display OK, otherwise it will display an error message +2. If TIMESTAMP is specified, the following additional information is displayed: + Database: The name of the database to which the backup data originally belonged + Details: In the form of Json, the data directory and file structure of the entire backup are displayed + ### Example +1. View the existing backups in the repository example_repo + + ```sql + SHOW SNAPSHOT ON example_repo; + ```` + +2. View only the backup named backup1 in the repository example_repo: + + ```sql + SHOW SNAPSHOT ON example_repo WHERE SNAPSHOT = "backup1"; + ```` + +3. View the details of the backup named backup1 in the warehouse example_repo with the time version "2018-05-05-15-34-26": + + ```sql + SHOW SNAPSHOT ON example_repo + WHERE SNAPSHOT = "backup1" AND TIMESTAMP = "2018-05-05-15-34-26"; + ```` + ### Keywords SHOW, SNAPSHOT diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md index 9d26596d1f..9664ea925b 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md @@ -1,6 +1,6 @@ --- { - "title": "SHOW-STATUS", + "title": "SHOW ALTER TABLE MATERIALIZED VIEW", "language": "en" } --- @@ -24,15 +24,97 @@ specific language governing permissions and limitations under the License. --> -## SHOW-STATUS +## SHOW ALTER TABLE MATERIALIZED VIEW + +### Name + +SHOW ALTER TABLE MATERIALIZED VIEW ### Description +This command is used to view the execution of the Create Materialized View job submitted through the [CREATE-MATERIALIZED-VIEW](../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-MATERIALIZED-VIEW.html) statement. + +> This statement is equivalent to `SHOW ALTER TABLE ROLLUP`; + +```sql +SHOW ALTER TABLE MATERIALIZED VIEW +[FROM database] +[WHERE] +[ORDER BY] +[LIMIT OFFSET] +```` + +- database: View jobs under the specified database. If not specified, the current database is used. +- WHERE: You can filter the result column, currently only the following columns are supported: + - TableName: Only equal value filtering is supported. + - State: Only supports equivalent filtering. + - Createtime/FinishTime: Support =, >=, <=, >, <, != +- ORDER BY: The result set can be sorted by any column. +- LIMIT: Use ORDER BY to perform page-turning query. + +Return result description: + +```sql +mysql> show alter table materialized view\G +**************************** 1. row ******************** ****** + JobId: 11001 + TableName: tbl1 + CreateTime: 2020-12-23 10:41:00 + FinishTime: NULL + BaseIndexName: tbl1 +RollupIndexName: r1 + RollupId: 11002 + TransactionId: 5070 + State: WAITING_TXN + Msg: + Progress: NULL + Timeout: 86400 +1 row in set (0.00 sec) +```` + +- `JobId`: Job unique ID. + +- `TableName`: base table name + +- `CreateTime/FinishTime`: Job creation time and end time. + +- `BaseIndexName/RollupIndexName`: Base table name and materialized view name. + +- `RollupId`: The unique ID of the materialized view. + +- `TransactionId`: See the description of the State field. + +- `State`: job status. + + - PENDING: The job is in preparation. + + - WAITING_TXN: + + Before officially starting to generate materialized view data, it will wait for the current running import transaction on this table to complete. And the `TransactionId` field is the current waiting transaction ID. When all previous imports for this ID are complete, the job will actually start. + + - RUNNING: The job is running. + + - FINISHED: The job ran successfully. + + - CANCELLED: The job failed to run. + +- `Msg`: error message + +- `Progress`: job progress. The progress here means `completed tablets/total tablets`. Materialized views are created at tablet granularity. + +- `Timeout`: Job timeout, in seconds. + ### Example +1. View the materialized view jobs under the database example_db + + ```sql + SHOW ALTER TABLE MATERIALIZED VIEW FROM example_db; + ```` + ### Keywords - SHOW, STATUS + SHOW, ALTER, TABLE, MATERIALIZED, VIEW ### Best Practice diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md index 840d3e00c5..46d1a8b015 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md @@ -26,10 +26,71 @@ under the License. ## SHOW-STREAM-LOAD +### Name + +SHOW STREAM LOAD + ### Description +This statement is used to display the execution of the specified Stream Load task + +grammar: + +```sql +SHOW STREAM LOAD +[FROM db_name] +[ + WHERE + [LABEL [ = "your_label" | LIKE "label_matcher"]] + [STATUS = ["SUCCESS"|"FAIL"]] +] +[ORDER BY...] +[LIMIT limit][OFFSET offset]; +```` + +illustrate: + +1. If db_name is not specified, the current default db is used +2. If LABEL LIKE is used, it will match the tasks whose label of the Stream Load task contains label_matcher +3. If LABEL = is used, it will match the specified label exactly +4. If STATUS is specified, matches STREAM LOAD status +5. You can use ORDER BY to sort on any combination of columns +6. If LIMIT is specified, limit matching records are displayed. Otherwise show all +7. If OFFSET is specified, the query results are displayed starting at offset offset. By default the offset is 0. + ### Example +1. Show all Stream Load tasks of the default db + + ```sql + SHOW STREAM LOAD; + ```` + +2. Display the Stream Load task of the specified db, the label contains the string "2014_01_02", and display the oldest 10 + + ```sql + SHOW STREAM LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10; + ```` + +3. Display the Stream Load task of the specified db and specify the label as "load_example_db_20140102" + + ```sql + SHOW STREAM LOAD FROM example_db WHERE LABEL = "load_example_db_20140102"; + ```` + +4. Display the Stream Load task of the specified db, specify the status as "success", and sort by StartTime in descending order + + ```sql + SHOW STREAM LOAD FROM example_db WHERE STATUS = "success" ORDER BY StartTime DESC; + ```` + +5. Display the import tasks of the specified db and sort them in descending order of StartTime, and display 10 query results starting from offset 5 + + ```sql + SHOW STREAM LOAD FROM example_db ORDER BY StartTime DESC limit 5,10; + SHOW STREAM LOAD FROM example_db ORDER BY StartTime DESC limit 10 offset 5; + ```` + ### Keywords SHOW, STREAM, LOAD diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md index c258941f9d..57b27c5258 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md @@ -28,10 +28,34 @@ under the License. ## SHOW-SYNC-JOB +### Name + +SHOW SYNC JOB + ### Description +This command is used to currently display the status of resident data synchronization jobs in all databases. + +grammar: + +```sql +SHOW SYNC JOB [FROM db_name] +```` + ### Example +1. Display the status of all data synchronization jobs in the current database. + + ```sql + SHOW SYNC JOB; + ```` + +2. Display the status of all data synchronization jobs under the database `test_db`. + + ```sql + SHOW SYNC JOB FROM `test_db`; + ```` + ### Keywords SHOW, SYNC, JOB diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md index 015bbfd325..58197ed08c 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md @@ -26,10 +26,28 @@ under the License. ## SHOW-TABLE-ID +### Name + +SHOW TABLE ID + ### Description +This statement is used to find the corresponding database name, table name according to the table id (only for administrators) + +grammar: + +```sql +SHOW TABLE [table_id] +```` + ### Example + 1. Find the corresponding database name, table name according to the table id + + ```sql + SHOW TABLE 10001; + ```` + ### Keywords SHOW, TABLE, ID diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md index 9bf2bf5806..367ccfcd84 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md @@ -26,10 +26,39 @@ under the License. ## SHOW-TABLE-STATUS +### Name + +SHOW TABLE STATUS + ### Description +This statement is used to view some information about the Table. + +grammar: + +```sql +SHOW TABLE STATUS +[FROM db] [LIKE "pattern"] +```` + +illustrate: + +1. This statement is mainly used to be compatible with MySQL syntax, currently only a small amount of information such as Comment is displayed + ### Example + 1. View the information of all tables under the current database + + ```sql + SHOW TABLE STATUS; + ```` + + 2. View the information of the table whose name contains example under the specified database + + ```sql + SHOW TABLE STATUS FROM db LIKE "%example%"; + ```` + ### Keywords SHOW, TABLE, STATUS diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md index 8478411b5b..a3c7aade14 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md @@ -26,10 +26,28 @@ under the License. ## SHOW-TABLET +### Name + +SHOW TABLET + ### Description +This statement is used to display the specified tablet id information (only for administrators) + +grammar: + +```sql +SHOW TABLET tablet_id +```` + ### Example +1. Display the parent-level id information of the tablet with the specified tablet id of 10000 + + ```sql + SHOW TABLET 10000; + ```` + ### Keywords SHOW, TABLET diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md index b04e5dfdba..0e3c807dc0 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md @@ -26,10 +26,78 @@ under the License. ## SHOW-TRANSACTION +### Name + +SHOW TRANSACTION + ### Description +This syntax is used to view transaction details for the specified transaction id or label. + +grammar: + +```sql +SHOW TRANSACTION +[FROM db_name] +WHERE +[id=transaction_id] +[label = label_name]; +```` + +Example of returned result: + +```` + TransactionId: 4005 + Label: insert_8d807d5d-bcdd-46eb-be6d-3fa87aa4952d + Coordinator: FE: 10.74.167.16 + TransactionStatus: VISIBLE + LoadJobSourceType: INSERT_STREAMING + PrepareTime: 2020-01-09 14:59:07 + CommitTime: 2020-01-09 14:59:09 + FinishTime: 2020-01-09 14:59:09 + Reason: +ErrorReplicasCount: 0 + ListenerId: -1 + TimeoutMs: 300000 +```` + +* TransactionId: transaction id +* Label: the label corresponding to the import task +* Coordinator: The node responsible for transaction coordination +* TransactionStatus: transaction status + * PREPARE: preparation stage + * COMMITTED: The transaction succeeded, but the data was not visible + * VISIBLE: The transaction succeeded and the data is visible + * ABORTED: Transaction failed +* LoadJobSourceType: Type of import job. +* PrepareTime: transaction start time +* CommitTime: The time when the transaction was successfully committed +* FinishTime: The time when the data is visible +* Reason: error message +* ErrorReplicasCount: The number of replicas with errors +* ListenerId: The id of the related import job +* TimeoutMs: Transaction timeout, in milliseconds + ### Example +1. View the transaction with id 4005: + + ```sql + SHOW TRANSACTION WHERE ID=4005; + ```` + +2. In the specified db, view the transaction with id 4005: + + ```sql + SHOW TRANSACTION FROM db WHERE ID=4005; + ```` + +3. View the transaction whose label is label_name: + + ```sql + SHOW TRANSACTION WHERE LABEL = 'label_name'; + ```` + ### Keywords SHOW, TRANSACTION diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md index 6ab1c01086..83d73250b8 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md @@ -26,10 +26,48 @@ under the License. ## SHOW-VARIABLES +### Name + +SHOW VARIABLES + ### Description +The modified statement is used to display Doris system variables, which can be queried by conditions + +grammar: + +````sql +SHOW [GLOBAL | SESSION] VARIABLES + [LIKE 'pattern' | WHERE expr] +```` + +illustrate: + +- show variables is mainly used to view the values of system variables. +- Executing the SHOW VARIABLES command does not require any privileges, it only requires being able to connect to the server. +- Use the like statement to match with variable_name. +- The % percent wildcard can be used anywhere in the matching pattern + ### Example +1. The default here is to match the Variable_name, here is the exact match + + ```sql + show variables like 'max_connections'; + ```` + +2. Matching through the percent sign (%) wildcard can match multiple items + + ```sql + show variables like '%connec%'; + ```` + +3. Use the Where clause for matching queries + + ```sql + show variables where variable_name = 'version'; + ```` + ### Keywords SHOW, VARIABLES diff --git a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md index e638427cf8..966db4136b 100644 --- a/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md +++ b/new-docs/en/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md @@ -26,10 +26,28 @@ under the License. ## SHOW-VIEW +### Name + +SHOW VIEW + ### Description +This statement is used to display all views based on the given table + +grammar: + +```sql + SHOW VIEW { FROM | IN } table [ FROM db ] +```` + ### Example +1. Show all views created based on table testTbl + + ```sql + SHOW VIEW FROM testTbl; + ```` + ### Keywords SHOW, VIEW diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md new file mode 100644 index 0000000000..5cb3a687ed --- /dev/null +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER-TABLE-MATERIALIZED-VIEW.md @@ -0,0 +1,120 @@ +--- +{ + "title": "SHOW ALTER TABLE MATERIALIZED VIEW", + "language": "zh-CN" +} +--- + + + +## SHOW ALTER TABLE MATERIALIZED VIEW + +### Name + +SHOW ALTER TABLE MATERIALIZED VIEW + +### Description + +该命令用于查看通过 [CREATE-MATERIALIZED-VIEW](../../sql-manual/sql-reference-v2/Data-Definition-Statements/Create/CREATE-MATERIALIZED-VIEW.html) 语句提交的创建物化视图作业的执行情况。 + +> 该语句等同于 `SHOW ALTER TABLE ROLLUP`; + +```sql +SHOW ALTER TABLE MATERIALIZED VIEW +[FROM database] +[WHERE] +[ORDER BY] +[LIMIT OFFSET] +``` + +- database:查看指定数据库下的作业。如不指定,使用当前数据库。 +- WHERE:可以对结果列进行筛选,目前仅支持对以下列进行筛选: + - TableName:仅支持等值筛选。 + - State:仅支持等值筛选。 + - Createtime/FinishTime:支持 =,>=,<=,>,<,!= +- ORDER BY:可以对结果集按任意列进行排序。 +- LIMIT:配合 ORDER BY 进行翻页查询。 + +返回结果说明: + +```sql +mysql> show alter table materialized view\G +*************************** 1. row *************************** + JobId: 11001 + TableName: tbl1 + CreateTime: 2020-12-23 10:41:00 + FinishTime: NULL + BaseIndexName: tbl1 +RollupIndexName: r1 + RollupId: 11002 + TransactionId: 5070 + State: WAITING_TXN + Msg: + Progress: NULL + Timeout: 86400 +1 row in set (0.00 sec) +``` + +- `JobId`:作业唯一ID。 + +- `TableName`:基表名称 + +- `CreateTime/FinishTime`:作业创建时间和结束时间。 + +- `BaseIndexName/RollupIndexName`:基表名称和物化视图名称。 + +- `RollupId`:物化视图的唯一 ID。 + +- `TransactionId`:见 State 字段说明。 + +- `State`:作业状态。 + + - PENDING:作业准备中。 + + - WAITING_TXN: + + 在正式开始产生物化视图数据前,会等待当前这个表上的正在运行的导入事务完成。而 `TransactionId` 字段就是当前正在等待的事务ID。当这个ID之前的导入都完成后,就会实际开始作业。 + + - RUNNING:作业运行中。 + + - FINISHED:作业运行成功。 + + - CANCELLED:作业运行失败。 + +- `Msg`:错误信息 + +- `Progress`:作业进度。这里的进度表示 `已完成的tablet数量/总tablet数量`。创建物化视图是按 tablet 粒度进行的。 + +- `Timeout`:作业超时时间,单位秒。 + +### Example + +1. 查看数据库 example_db 下的物化视图作业 + + ```sql + SHOW ALTER TABLE MATERIALIZED VIEW FROM example_db; + ``` + +### Keywords + + SHOW, ALTER, TABLE, MATERIALIZED, VIEW + +### Best Practice + diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md index d4cd8586be..8c665814c1 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ALTER.md @@ -3,6 +3,7 @@ "title": "SHOW-ALTER", "language": "zh-CN" } + --- + +## SHOW-LAST-INSERT + +### Name + +SHOW LAST INSERT + +### Description + +该语法用于查看在当前session连接中,最近一次 insert 操作的结果 + +语法: + +```sql +SHOW LAST INSERT +``` + +返回结果示例: + +``` + TransactionId: 64067 + Label: insert_ba8f33aea9544866-8ed77e2844d0cc9b + Database: default_cluster:db1 + Table: t1 +TransactionStatus: VISIBLE + LoadedRows: 2 + FilteredRows: 0 +``` + +说明: + +* TransactionId:事务id +* Label:insert任务对应的 label +* Database:insert对应的数据库 +* Table:insert对应的表 +* TransactionStatus:事务状态 + * PREPARE:准备阶段 + * PRECOMMITTED:预提交阶段 + * COMMITTED:事务成功,但数据不可见 + * VISIBLE:事务成功且数据可见 + * ABORTED:事务失败 +* LoadedRows:导入的行数 +* FilteredRows:被过滤的行数 + +### Example + +### Keywords + + SHOW, LAST, INSERT + +### Best Practice + diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md index 99f389b8a1..de2fdfc3b9 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-LOAD.md @@ -26,10 +26,89 @@ under the License. ## SHOW-LOAD +### Name + +SHOW LOAD + ### Description +该语句用于展示指定的导入任务的执行情况 + +语法: + +```sql +SHOW LOAD +[FROM db_name] +[ + WHERE + [LABEL [ = "your_label" | LIKE "label_matcher"]] + [STATE = ["PENDING"|"ETL"|"LOADING"|"FINISHED"|"CANCELLED"|]] +] +[ORDER BY ...] +[LIMIT limit][OFFSET offset]; +``` + +说明: + +1) 如果不指定 db_name,使用当前默认db + +1) 如果使用 LABEL LIKE,则会匹配导入任务的 label 包含 label_matcher 的导入任务 + +1) 如果使用 LABEL = ,则精确匹配指定的 label + +1) 如果指定了 STATE,则匹配 LOAD 状态 + +1) 可以使用 ORDER BY 对任意列组合进行排序 + +1) 如果指定了 LIMIT,则显示 limit 条匹配记录。否则全部显示 + +1) 如果指定了 OFFSET,则从偏移量offset开始显示查询结果。默认情况下偏移量为0。 + +1) 如果是使用 broker/mini load,则 URL 列中的连接可以使用以下命令查看: + + ```sql + SHOW LOAD WARNINGS ON 'url' + ``` + ### Example +1. 展示默认 db 的所有导入任务 + + ```sql + SHOW LOAD; + ``` + +1. 展示指定 db 的导入任务,label 中包含字符串 "2014_01_02",展示最老的10个 + + ```sql + SHOW LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10; + ``` + +1. 展示指定 db 的导入任务,指定 label 为 "load_example_db_20140102" 并按 LoadStartTime 降序排序 + + ```sql + SHOW LOAD FROM example_db WHERE LABEL = "load_example_db_20140102" ORDER BY LoadStartTime DESC; + ``` + +1. 展示指定 db 的导入任务,指定 label 为 "load_example_db_20140102" ,state 为 "loading", 并按 LoadStartTime 降序排序 + + ```sql + SHOW LOAD FROM example_db WHERE LABEL = "load_example_db_20140102" AND STATE = "loading" ORDER BY LoadStartTime DESC; + ``` + +1. 展示指定 db 的导入任务 并按 LoadStartTime 降序排序,并从偏移量5开始显示10条查询结果 + + ```sql + SHOW LOAD FROM example_db ORDER BY LoadStartTime DESC limit 5,10; + SHOW LOAD FROM example_db ORDER BY LoadStartTime DESC limit 10 offset 5; + ``` + +1. 小批量导入是查看导入状态的命令 + + ``` + curl --location-trusted -u {user}:{passwd} http://{hostname}:{port}/api/{database}/_load_info?label={labelname} + ``` + ### Keywords SHOW, LOAD diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md index 260e36b2de..fd853193e0 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-MIGRATIONS.md @@ -26,8 +26,20 @@ under the License. ## SHOW-MIGRATIONS +### Name + +SHOW MIGRATIONS + ### Description +该语句用于查看数据库迁移的进度 + +语法: + +```sql +SHOW MIGRATIONS +``` + ### Example ### Keywords diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-OPEN-TABLES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-OPEN-TABLES.md index 9ca35094e9..129bd8c73a 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-OPEN-TABLES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-OPEN-TABLES.md @@ -26,8 +26,20 @@ under the License. ## SHOW-OPEN-TABLES +### Name + +SHOW TABLES + ### Description +该语句用于展示当前 db 下所有的 table + +语法: + +```SQL +SHOW TABLES +``` + ### Example ### Keywords diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md index b58e65bf0e..5134064f87 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITION-ID.md @@ -26,10 +26,28 @@ under the License. ## SHOW-PARTITION-ID +### Name + +SHOW PARTITION ID + ### Description +该语句用于根据 partition id 查找对应的 database name, table name, partition name(仅管理员使用) + + 语法: + + ```SQL + SHOW PARTITION [partition_id] + ``` + ### Example +1. 根据 partition id 查找对应的 database name, table name, partition name + + ```sql + SHOW PARTITION 10002; + ``` + ### Keywords SHOW, PARTITION, ID diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md index 7fe2712553..0b06cba8dc 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PARTITIONS.md @@ -26,10 +26,51 @@ under the License. ## SHOW-PARTITIONS +### Name + +SHOW PARTITIONS + ### Description + 该语句用于展示分区信息 + +语法: + +```SQL + SHOW [TEMPORARY] PARTITIONS FROM [db_name.]table_name [WHERE] [ORDER BY] [LIMIT]; +``` + +说明: + +1. 支持PartitionId,PartitionName,State,Buckets,ReplicationNum,LastConsistencyCheckTime等列的过滤 +2. TEMPORARY指定列出临时分区 + ### Example +1.展示指定db下指定表的所有非临时分区信息 + +```SQL + SHOW PARTITIONS FROM example_db.table_name; +``` + +2. 展示指定db下指定表的所有临时分区信 + + ```SQL + SHOW TEMPORARY PARTITIONS FROM example_db.table_name; + ``` + +3. 展示指定db下指定表的指定非临时分区的信息 + + ```SQL + SHOW PARTITIONS FROM example_db.table_name WHERE PartitionName = "p1"; + ``` + +4. 展示指定db下指定表的最新非临时分区的信息 + + ```SQL + SHOW PARTITIONS FROM example_db.table_name ORDER BY PartitionId DESC LIMIT 1; + ``` + ### Keywords SHOW, PARTITIONS diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md index 2b74d9f1a0..fb146baf15 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PLUGINS.md @@ -26,10 +26,30 @@ under the License. ## SHOW-PLUGINS +### Name + +SHOW PLUGINS + ### Description +该语句用于展示已安装的插件 + +语法: + +```SQL +SHOW PLUGINS +``` + +该命令会展示所有用户安装的和系统内置的插件 + ### Example +1. 展示已安装的插件: + + ```SQL + SHOW PLUGINS; + ``` + ### Keywords SHOW, PLUGINS diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md index e17b4323e0..1f9d3ed506 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROCESSLIST.md @@ -26,10 +26,40 @@ under the License. ## SHOW-PROCESSLIST +### Name + +SHOW PROCESSLIST + ### Description +显示用户正在运行的线程,需要注意的是,除了 root 用户能看到所有正在运行的线程外,其他用户都只能看到自己正在运行的线程,看不到其它用户正在运行的线程 + +语法: + +```sql +SHOW [FULL] PROCESSLIST +``` + +说明: + +- Id: 就是这个线程的唯一标识,当我们发现这个线程有问题的时候,可以通过 kill 命令,加上这个Id值将这个线程杀掉。前面我们说了show processlist 显示的信息时来自information_schema.processlist 表,所以这个Id就是这个表的主键。 +- User: 就是指启动这个线程的用户。 +- Host: 记录了发送请求的客户端的 IP 和 端口号。通过这些信息在排查问题的时候,我们可以定位到是哪个客户端的哪个进程发送的请求。 +- Cluster:集群名称 +- DB: 当前执行的命令是在哪一个数据库上。如果没有指定数据库,则该值为 NULL 。 +- Command: 是指此刻该线程正在执行的命令。这个很复杂,下面单独解释 +- Time: 表示该线程处于当前状态的时间。 +- State: 线程的状态,和 Command 对应,下面单独解释。 +- Info: 一般记录的是线程执行的语句。默认只显示前100个字符,也就是你看到的语句可能是截断了的,要看全部信息,需要使用 show full processlist。 + ### Example +1. 查看当前用户尽在运行的线程 + + ```SQL + SHOW PROCESSLIST + ``` + ### Keywords SHOW, PROCESSLIST diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md index bf68a42cea..82ca0aa97d 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-PROPERTY.md @@ -26,26 +26,32 @@ under the License. ## SHOW-PROPERTY +### Name + +SHOW PROPERTY + ### Description 该语句用于查看用户的属性 -``` -SHOW PROPERTY [FOR user] [LIKE key]; +语法: + +```sql +SHOW PROPERTY [FOR user] [LIKE key] ``` * `user` - 查看指定用户的属性。如不指定,查看当前用户的。 - + 查看指定用户的属性。 如果未指定,请检查当前用户的。 + * `LIKE` - 可以通过属性名模糊匹配。 - + 模糊匹配可以通过属性名来完成。 + 返回结果说明: ```sql -mysql> show property like '%connection%'; +mysql> show property like'%connection%'; +----------------------+-------+ | Key | Value | +----------------------+-------+ @@ -56,25 +62,25 @@ mysql> show property like '%connection%'; * `Key` - 属性名。 - + 属性名. + * `Value` - 属性值。 + 属性值. ### Example 1. 查看 jack 用户的属性 - - ```sql - SHOW PROPERTY FOR 'jack'; - ``` -2. 查看 jack 用户连接数限制属性 + ```sql + SHOW PROPERTY FOR 'jack' + ``` - ```sql - SHOW PROPERTY FOR 'jack' LIKE '%connection%'; - ``` +2. 查看 jack 用户导入cluster相关属性 + + ```sql + SHOW PROPERTY FOR 'jack' LIKE '%load_cluster%' + ``` ### Keywords diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md index 8f405c921f..7dc5fb8292 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-REPOSITORIES.md @@ -26,10 +26,39 @@ under the License. ## SHOW-REPOSITORIES +### Name + +SHOW REPOSITORIES + ### Description +该语句用于查看当前已创建的仓库 + +语法: + +```sql +SHOW REPOSITORIES; +``` + +说明: + +1. 各列含义如下: + RepoId: 唯一的仓库ID + RepoName: 仓库名称 + CreateTime: 第一次创建该仓库的时间 + IsReadOnly: 是否为只读仓库 + Location: 仓库中用于备份数据的根目录 + Broker: 依赖的 Broker + ErrMsg: Doris 会定期检查仓库的连通性,如果出现问题,这里会显示错误信息 + ### Example +1. 查看已创建的仓库: + +```sql + SHOW REPOSITORIES; +``` + ### Keywords SHOW, REPOSITORIES diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md index 47794b543b..9a4a7f5a60 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESOURCES.md @@ -26,10 +26,56 @@ under the License. ## SHOW-RESOURCES +### Name + +SHOW RESOURCES + ### Description +该语句用于展示用户有使用权限的资源。普通用户仅能展示有使用权限的资源,root 或 admin 用户会展示所有的资源。 + +语法: + +```sql +SHOW RESOURCES +[ + WHERE + [NAME [ = "your_resource_name" | LIKE "name_matcher"]] + [RESOURCETYPE = ["SPARK"]] +] +[ORDER BY ...] +[LIMIT limit][OFFSET offset]; +``` + +说明: + +1. 如果使用 NAME LIKE,则会匹配 RESOURCES 的 Name 包含 name_matcher 的Resource +2. 如果使用 NAME = ,则精确匹配指定的 Name +3. 如果指定了 RESOURCETYPE,则匹配对应的 Resrouce 类型 +4. 可以使用 ORDER BY 对任意列组合进行排序 +5. 如果指定了 LIMIT,则显示 limit 条匹配记录。否则全部显示 +6. 如果指定了 OFFSET,则从偏移量 offset 开始显示查询结果。默认情况下偏移量为0。 + ### Example +1. 展示当前用户拥有权限的所有 Resource + + ```sql + SHOW RESOURCES; + ``` + +1. 展示指定 Resource ,NAME 中包含字符串 "20140102",展示10个属性 + + ```sql + SHOW RESOURCES WHERE NAME LIKE "2014_01_02" LIMIT 10; + ``` + +1. 展示指定 Resource ,指定 NAME 为 "20140102" 并按 KEY 降序排序 + + ```sql + SHOW RESOURCES WHERE NAME = "20140102" ORDER BY `KEY` DESC; + ``` + ### Keywords SHOW, RESOURCES diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md index cdf9b2e8b4..371d9725a7 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-RESTORE.md @@ -26,10 +26,56 @@ under the License. ## SHOW-RESTORE +### Name + +SHOW RESTORE + ### Description +该语句用于查看 RESTORE 任务 + +语法: + +```SQL +SHOW RESTORE [FROM DB_NAME] +``` + +说明: + 1. Doris 中仅保存最近一次 RESTORE 任务。 + 2. 各列含义如下: + JobId: 唯一作业id + Label: 要恢复的备份的名称 + Timestamp: 要恢复的备份的时间版本 + DbName: 所属数据库 + State: 当前阶段 + PENDING: 提交作业后的初始状态 + SNAPSHOTING: 执行快照中 + DOWNLOAD: 快照完成,准备下载仓库中的快照 + DOWNLOADING: 快照下载中 + COMMIT: 快照下载完成,准备生效 + COMMITING: 生效中 + FINISHED: 作业成功 + CANCELLED: 作业失败 + AllowLoad: 恢复时是否允许导入(当前不支持) + ReplicationNum: 指定恢复的副本数 + RestoreJobs: 要恢复的表和分区 + CreateTime: 任务提交时间 + MetaPreparedTime: 元数据准备完成时间 + SnapshotFinishedTime: 快照完成时间 + DownloadFinishedTime: 快照下载完成时间 + FinishedTime: 作业结束时间 + UnfinishedTasks: 在 SNAPSHOTING、DOWNLOADING 和 COMMITING 阶段会显示还未完成的子任务id + Status: 如果作业失败,显示失败信息 + Timeout: 作业超时时间,单位秒 + ### Example +1. 查看 example_db 下最近一次 RESTORE 任务。 + + ```sql + SHOW RESTORE FROM example_db; + ``` + ### Keywords SHOW, RESTORE diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md index b9229c5c50..5e9837ec9f 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROLES.md @@ -26,10 +26,28 @@ under the License. ## SHOW-ROLES +### Name + +SHOW ROLES + ### Description +该语句用于展示所有已创建的角色信息,包括角色名称,包含的用户以及权限。 + +语法: + +```SQL +SHOW ROLES +``` + ### Example +1. 查看已创建的角色 + + ```SQL + SHOW ROLES + ``` + ### Keywords SHOW, ROLES diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md index 3370348a0e..b9f4c610ff 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD-TASK.md @@ -26,13 +26,55 @@ under the License. ## SHOW-ROUTINE-LOAD-TASK +### Name + +SHOW ROUTINE LOAD TASK + ### Description +查看一个指定的 Routine Load 作业的当前正在运行的子任务情况。 + +```sql +SHOW ROUTINE LOAD TASK +WHERE JobName = "job_name"; +``` + +返回结果如下: + +```text + TaskId: d67ce537f1be4b86-abf47530b79ab8e6 + TxnId: 4 + TxnStatus: UNKNOWN + JobId: 10280 + CreateTime: 2020-12-12 20:29:48 + ExecuteStartTime: 2020-12-12 20:29:48 + Timeout: 20 + BeId: 10002 +DataSourceProperties: {"0":19} +``` + +- `TaskId`:子任务的唯一 ID。 +- `TxnId`:子任务对应的导入事务 ID。 +- `TxnStatus`:子任务对应的导入事务状态。通常为 UNKNOWN。并无实际意思。 +- `JobId`:子任务对应的作业 ID。 +- `CreateTime`:子任务的创建时间。 +- `ExecuteStartTime`:子任务被调度执行的时间,通常晚于创建时间。 +- `Timeout`:子任务超时时间,通常是作业设置的 `MaxIntervalS` 的两倍。 +- `BeId`:执行这个子任务的 BE 节点 ID。 +- `DataSourceProperties`:子任务准备消费的 Kafka Partition 的起始 offset。是一个 Json 格式字符串。Key 为 Partition Id。Value 为消费的起始 offset。 + ### Example +1. 展示名为 test1 的例行导入任务的子任务信息。 + + ```sql + SHOW ROUTINE LOAD TASK WHERE JobName = "test1"; + ``` + ### Keywords SHOW, ROUTINE, LOAD, TASK ### Best Practice +通过这个命令,可以查看一个 Routine Load 作业当前有多少子任务在运行,具体运行在哪个 BE 节点上。 diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md index 29347c3241..b08ac7c909 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-ROUTINE-LOAD.md @@ -26,10 +26,101 @@ under the License. ## SHOW-ROUTINE-LOAD +### Name + +SHOW ROUTINE LOAD + ### Description +该语句用于展示 Routine Load 作业运行状态 + +语法: + +```sql +SHOW [ALL] ROUTINE LOAD [FOR jobName]; +``` + +结果说明: + +``` + Id: 作业ID + Name: 作业名称 + CreateTime: 作业创建时间 + PauseTime: 最近一次作业暂停时间 + EndTime: 作业结束时间 + DbName: 对应数据库名称 + TableName: 对应表名称 + State: 作业运行状态 + DataSourceType: 数据源类型:KAFKA + CurrentTaskNum: 当前子任务数量 + JobProperties: 作业配置详情 +DataSourceProperties: 数据源配置详情 + CustomProperties: 自定义配置 + Statistic: 作业运行状态统计信息 + Progress: 作业运行进度 + Lag: 作业延迟状态 +ReasonOfStateChanged: 作业状态变更的原因 + ErrorLogUrls: 被过滤的质量不合格的数据的查看地址 + OtherMsg: 其他错误信息 +``` + +* State + + 有以下4种State: + * NEED_SCHEDULE:作业等待被调度 + * RUNNING:作业运行中 + * PAUSED:作业被暂停 + * STOPPED:作业已结束 + * CANCELLED:作业已取消 + +* Progress + + 对于Kafka数据源,显示每个分区当前已消费的offset。如 {"0":"2"} 表示Kafka分区0的消费进度为2。 + +* Lag + + 对于Kafka数据源,显示每个分区的消费延迟。如{"0":10} 表示Kafka分区0的消费延迟为10。 + ### Example +1. 展示名称为 test1 的所有例行导入作业(包括已停止或取消的作业)。结果为一行或多行。 + + ```sql + SHOW ALL ROUTINE LOAD FOR test1; + ``` + +2. 展示名称为 test1 的当前正在运行的例行导入作业 + + ```sql + SHOW ROUTINE LOAD FOR test1; + ``` + +3. 显示 example_db 下,所有的例行导入作业(包括已停止或取消的作业)。结果为一行或多行。 + + ```sql + use example_db; + SHOW ALL ROUTINE LOAD; + ``` + +4. 显示 example_db 下,所有正在运行的例行导入作业 + + ```sql + use example_db; + SHOW ROUTINE LOAD; + ``` + +5. 显示 example_db 下,名称为 test1 的当前正在运行的例行导入作业 + + ```sql + SHOW ROUTINE LOAD FOR example_db.test1; + ``` + +6. 显示 example_db 下,名称为 test1 的所有例行导入作业(包括已停止或取消的作业)。结果为一行或多行。 + + ```sql + SHOW ALL ROUTINE LOAD FOR example_db.test1; + ``` + ### Keywords SHOW, ROUTINE, LOAD diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md index eaf3f79b97..da8bd54c5c 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SMALL-FILES.md @@ -26,10 +26,35 @@ under the License. ## SHOW-SMALL-FILES +### Name + +SHOW FILE + ### Description +该语句用于展示一个数据库内,由 CREATE FILE 命令创建的文件。 + +```sql +SHOW FILE [FROM database]; +``` + +返回结果说明: + +- FileId: 文件ID,全局唯一 +- DbName: 所属数据库名称 +- Catalog: 自定义分类 +- FileName: 文件名 +- FileSize: 文件大小,单位字节 +- MD5: 文件的 MD5 + ### Example +1. 查看数据库 my_database 中已上传的文件 + + ```sql + SHOW FILE FROM my_database; + ``` + ### Keywords SHOW, SMALL, FILES diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md index c82cc9a2b5..bdddd026ad 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SNAPSHOT.md @@ -26,10 +26,51 @@ under the License. ## SHOW-SNAPSHOT +### Name + +SHOW SNAPSHOT + ### Description +该语句用于查看仓库中已存在的备份。 + +语法: + +```sql +SHOW SNAPSHOT ON `repo_name` +[WHERE SNAPSHOT = "snapshot" [AND TIMESTAMP = "backup_timestamp"]]; +``` + +说明: + 1. 各列含义如下: + Snapshot: 备份的名称 + Timestamp: 对应备份的时间版本 + Status: 如果备份正常,则显示 OK,否则显示错误信息 + 2. 如果指定了 TIMESTAMP,则会额外显示如下信息: + Database: 备份数据原属的数据库名称 + Details: 以 Json 的形式,展示整个备份的数据目录及文件结构 + ### Example +1. 查看仓库 example_repo 中已有的备份 + + ```sql + SHOW SNAPSHOT ON example_repo; + ``` + +1. 仅查看仓库 example_repo 中名称为 backup1 的备份: + + ```sql + SHOW SNAPSHOT ON example_repo WHERE SNAPSHOT = "backup1"; + ``` + +1. 查看仓库 example_repo 中名称为 backup1 的备份,时间版本为 "2018-05-05-15-34-26" 的详细信息: + + ```sql + SHOW SNAPSHOT ON example_repo + WHERE SNAPSHOT = "backup1" AND TIMESTAMP = "2018-05-05-15-34-26"; + ``` + ### Keywords SHOW, SNAPSHOT diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md index 8f14f22e37..9bf954ef8c 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STATUS.md @@ -26,6 +26,10 @@ under the License. ## SHOW-STATUS +### Name + +SHOW STATUS + ### Description ### Example diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md index 71d32a9dcb..fd4fbff163 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-STREAM-LOAD.md @@ -26,10 +26,71 @@ under the License. ## SHOW-STREAM-LOAD +### Name + +SHOW STREAM LOAD + ### Description +该语句用于展示指定的Stream Load任务的执行情况 + +语法: + +```sql +SHOW STREAM LOAD +[FROM db_name] +[ + WHERE + [LABEL [ = "your_label" | LIKE "label_matcher"]] + [STATUS = ["SUCCESS"|"FAIL"]] +] +[ORDER BY ...] +[LIMIT limit][OFFSET offset]; +``` + +说明: + +1. 如果不指定 db_name,使用当前默认db +2. 如果使用 LABEL LIKE,则会匹配Stream Load任务的 label 包含 label_matcher 的任务 +3. 如果使用 LABEL = ,则精确匹配指定的 label +4. 如果指定了 STATUS,则匹配 STREAM LOAD 状态 +5. 可以使用 ORDER BY 对任意列组合进行排序 +6. 如果指定了 LIMIT,则显示 limit 条匹配记录。否则全部显示 +7. 如果指定了 OFFSET,则从偏移量offset开始显示查询结果。默认情况下偏移量为0。 + ### Example +1. 展示默认 db 的所有Stream Load任务 + + ```sql + SHOW STREAM LOAD; + ``` + +2. 展示指定 db 的Stream Load任务,label 中包含字符串 "2014_01_02",展示最老的10个 + + ```sql + SHOW STREAM LOAD FROM example_db WHERE LABEL LIKE "2014_01_02" LIMIT 10; + ``` + +2. 展示指定 db 的Stream Load任务,指定 label 为 "load_example_db_20140102" + + ```sql + SHOW STREAM LOAD FROM example_db WHERE LABEL = "load_example_db_20140102"; + ``` + +2. 展示指定 db 的Stream Load任务,指定 status 为 "success", 并按 StartTime 降序排序 + + ```sql + SHOW STREAM LOAD FROM example_db WHERE STATUS = "success" ORDER BY StartTime DESC; + ``` + +2. 展示指定 db 的导入任务 并按 StartTime 降序排序,并从偏移量5开始显示10条查询结果 + + ```sql + SHOW STREAM LOAD FROM example_db ORDER BY StartTime DESC limit 5,10; + SHOW STREAM LOAD FROM example_db ORDER BY StartTime DESC limit 10 offset 5; + ``` + ### Keywords SHOW, STREAM, LOAD diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md index 1f83ae0304..46252b2943 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-SYNC-JOB.md @@ -27,10 +27,34 @@ under the License. ## SHOW-SYNC-JOB +### Name + +SHOW SYNC JOB + ### Description +此命令用于当前显示所有数据库内的常驻数据同步作业状态。 + +语法: + +```sql +SHOW SYNC JOB [FROM db_name] +``` + ### Example +1. 展示当前数据库的所有数据同步作业状态。 + + ```sql + SHOW SYNC JOB; + ``` + +2. 展示数据库 `test_db` 下的所有数据同步作业状态。 + + ```sql + SHOW SYNC JOB FROM `test_db`; + ``` + ### Keywords SHOW, SYNC, JOB diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md index 10377090f0..2fa780564a 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-ID.md @@ -26,10 +26,28 @@ under the License. ## SHOW-TABLE-ID +### Name + +SHOW TABLE ID + ### Description +该语句用于根据 table id 查找对应的 database name, table name(仅管理员使用) + +语法: + +```sql +SHOW TABLE [table_id] +``` + ### Example + 1. 根据 table id 查找对应的 database name, table name + + ```sql + SHOW TABLE 10001; + ``` + ### Keywords SHOW, TABLE, ID diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md index 0993f3ba9f..591b37fb56 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLE-STATUS.md @@ -26,10 +26,39 @@ under the License. ## SHOW-TABLE-STATUS +### Name + +SHOW TABLE STATUS + ### Description +该语句用于查看 Table 的一些信息。 + +语法: + +```sql +SHOW TABLE STATUS +[FROM db] [LIKE "pattern"] +``` + +说明: + +1. 该语句主要用于兼容 MySQL 语法,目前仅显示 Comment 等少量信息 + ### Example + 1. 查看当前数据库下所有表的信息 + + ```sql +SHOW TABLE STATUS; + ``` + + 1. 查看指定数据库下,名称包含 example 的表的信息 + + ```sql + SHOW TABLE STATUS FROM db LIKE "%example%"; + ``` + ### Keywords SHOW, TABLE, STATUS diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md index 36e3f93775..bcc0f537ee 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TABLET.md @@ -26,10 +26,28 @@ under the License. ## SHOW-TABLET +### Name + +SHOW TABLET + ### Description +该语句用于显示指定tablet id 信息(仅管理员使用) + +语法: + +```sql +SHOW TABLET tablet_id +``` + ### Example +1. 显示指定 tablet id 为 10000 的 tablet 的父层级 id 信息 + + ```sql + SHOW TABLET 10000; + ``` + ### Keywords SHOW, TABLET diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md index 9033c6cba9..58c7b76b27 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-TRANSACTION.md @@ -26,10 +26,78 @@ under the License. ## SHOW-TRANSACTION +### Name + +SHOW TRANSACTION + ### Description +该语法用于查看指定 transaction id 或 label 的事务详情。 + +语法: + +```sql +SHOW TRANSACTION +[FROM db_name] +WHERE +[id = transaction_id] +[label = label_name]; +``` + +返回结果示例: + +``` + TransactionId: 4005 + Label: insert_8d807d5d-bcdd-46eb-be6d-3fa87aa4952d + Coordinator: FE: 10.74.167.16 + TransactionStatus: VISIBLE + LoadJobSourceType: INSERT_STREAMING + PrepareTime: 2020-01-09 14:59:07 + CommitTime: 2020-01-09 14:59:09 + FinishTime: 2020-01-09 14:59:09 + Reason: +ErrorReplicasCount: 0 + ListenerId: -1 + TimeoutMs: 300000 +``` + +* TransactionId:事务id +* Label:导入任务对应的 label +* Coordinator:负责事务协调的节点 +* TransactionStatus:事务状态 + * PREPARE:准备阶段 + * COMMITTED:事务成功,但数据不可见 + * VISIBLE:事务成功且数据可见 + * ABORTED:事务失败 +* LoadJobSourceType:导入任务的类型。 +* PrepareTime:事务开始时间 +* CommitTime:事务提交成功的时间 +* FinishTime:数据可见的时间 +* Reason:错误信息 +* ErrorReplicasCount:有错误的副本数 +* ListenerId:相关的导入作业的id +* TimeoutMs:事务超时时间,单位毫秒 + ### Example +1. 查看 id 为 4005 的事务: + + ```sql + SHOW TRANSACTION WHERE ID=4005; + ``` + +2. 指定 db 中,查看 id 为 4005 的事务: + + ```sql + SHOW TRANSACTION FROM db WHERE ID=4005; + ``` + +3. 查看 label 为 label_name的事务: + + ```sql + SHOW TRANSACTION WHERE LABEL = 'label_name'; + ``` + ### Keywords SHOW, TRANSACTION diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-USER.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-USER.md index c717dc01b3..1a6ccf098e 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-USER.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-USER.md @@ -26,6 +26,10 @@ under the License. ## SHOW-USER +### Name + +SHOW USER + ### Description ### Example diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md index f9419ababb..4a20fffeed 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VARIABLES.md @@ -26,10 +26,48 @@ under the License. ## SHOW-VARIABLES +### Name + +SHOW VARIABLES + ### Description +改语句是用来显示Doris系统变量,可以通过条件查询 + +语法: + +```sql +SHOW [GLOBAL | SESSION] VARIABLES + [LIKE 'pattern' | WHERE expr] +``` + +说明: + +- show variables主要是用来查看系统变量的值. +- 执行SHOW VARIABLES命令不需要任何权限,只要求能够连接到服务器就可以. +- 使用like语句表示用variable_name进行匹配. +- %百分号通配符可以用在匹配模式中的任何位置 + ### Example +1. 这里默认的就是对Variable_name进行匹配,这里是准确匹配 + + ```sql + show variables like 'max_connections'; + ``` + +2. 通过百分号(%)这个通配符进行匹配,可以匹配多项 + + ```sql + show variables like '%connec%'; + ``` + +3. 使用 Where 子句进行匹配查询 + + ```sql + show variables where variable_name = 'version'; + ``` + ### Keywords SHOW, VARIABLES diff --git a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md index 83388cac93..287ff6933a 100644 --- a/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md +++ b/new-docs/zh-CN/sql-manual/sql-reference-v2/Show-Statements/SHOW-VIEW.md @@ -26,10 +26,28 @@ under the License. ## SHOW-VIEW +### Name + +SHOW VIEW + ### Description +该语句用于展示基于给定表建立的所有视图 + +语法: + +```sql + SHOW VIEW { FROM | IN } table [ FROM db ] +``` + ### Example +1. 展示基于表 testTbl 建立的所有视图 view + + ```sql + SHOW VIEW FROM testTbl; + ``` + ### Keywords SHOW, VIEW