This is an automated email from the ASF dual-hosted git repository. dataroaring pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/doris-website.git
The following commit(s) were added to refs/heads/master by this push: new b23fa38fdd9 [doc] add DROP-CATALOG-RECYCLE-BIN (#705) b23fa38fdd9 is described below commit b23fa38fdd98ff85fd053613247a19549e0532ee Author: Liu Zhenlong <49094455+dragonliu2...@users.noreply.github.com> AuthorDate: Mon Jun 3 11:40:17 2024 +0800 [doc] add DROP-CATALOG-RECYCLE-BIN (#705) --- .../Drop/DROP-CATALOG-RECYCLE-BIN.md | 90 ++++++++++++++++++++++ .../Drop/DROP-CATALOG-RECYCLE-BIN.md | 90 ++++++++++++++++++++++ sidebars.json | 3 +- 3 files changed, 182 insertions(+), 1 deletion(-) diff --git a/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md new file mode 100644 index 00000000000..b1b776028b7 --- /dev/null +++ b/docs/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md @@ -0,0 +1,90 @@ +--- +{ + "title": "DROP-CATALOG-RECYCLE-BIN", + "language": "en" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## DROP-CATALOG-RECYCLE-BIN + +### Name + +DROP CATALOG RECYCLE BIN + +### Description + +This statement is used to delete db/table/partition in catalog recycle bin instantly. + +You can get all meta informations that can be deleted by statement `SHOW CATALOG RECYCLE BIN`. + +grammar: + +1. delete database by DbId + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'DbId' = db_id; + ``` + +2. delete table by TableId + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'TableId' = table_id; + ``` + + 3. delete partition by PartitionId + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = partition_id; + ``` + +illustrate: + +- When drop db/table/partition, the catalog recycle bin will delete them after catalog_trash_expire_second(in fe.conf) seconds. This statement will delete them to free disk usage timely. +- `'DbId'`, `'TableId'` and `'PartitionId'` will be case-insensitive and not distinguish between `'` and `''`. +- When drop a database which is not in catalog recycle bin, it will also delete all tables and partitions with same DbId in catalog recycle bin. Only if nothing is deleted,it will report an error. When drop a table which is not in catalog recycle bin, the treatment is similar. + +### Example + +1. Delete the database with id example_db_id + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'DbId' = example_db_id; + ``` + +2. Delete the table with id example_tbl_id + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'TableId' = example_tbl_id; + ``` + +3. Delete the partition with id p1_id + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = p1_id; + ``` + +### Keywords + +DROP, CATALOG, RECYCLE, BIN + +### Best Practice + diff --git a/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md new file mode 100644 index 00000000000..51365bace1e --- /dev/null +++ b/i18n/zh-CN/docusaurus-plugin-content-docs/current/sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN.md @@ -0,0 +1,90 @@ +--- +{ + "title": "DROP-CATALOG-RECYCLE-BIN", + "language": "zh-CN" +} +--- + +<!-- +Licensed to the Apache Software Foundation (ASF) under one +or more contributor license agreements. See the NOTICE file +distributed with this work for additional information +regarding copyright ownership. The ASF licenses this file +to you under the Apache License, Version 2.0 (the +"License"); you may not use this file except in compliance +with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, +software distributed under the License is distributed on an +"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, either express or implied. See the License for the +specific language governing permissions and limitations +under the License. +--> + +## DROP-CATALOG-RECYCLE-BIN + +### Name + +DROP CATALOG RECYCLE BIN + +### Description + +该语句用于立即删除回收站中的数据库、表 或者 分区。 + +可以通过 `SHOW CATALOG RECYCLE BIN` 来查询当前可删除的元信息。 + +语法: + +1. 根据 DbId 删除数据库 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'DbId' = db_id; + ``` + +2. 根据 TableId 删除表 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'TableId' = table_id; + ``` + +3. 根据 PartitionId 删除分区 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = partition_id; + ``` + +说明: + +- 当删除数据库、表或者分区时,回收站会在 `catalog_trash_expire_second`秒后将其删除(在 `fe.conf` 中设置)。此语句将立即删除它们。 +- `'DbId'`、 `'TableId'` 和 `'PartitionId'` 大小写不敏感且不区分单引号和双引号。 +- 当删除不在回收站中的数据库时,也会删除回收站中具有相同 `DbId` 的所有表和分区。只有在没有删除任何内容(数据库、表或分区)的情况下,它才会报错。当删除不在回收站中的表时,处理方法类似。 + +### Example + +1. 删除 id 为 example_db_id 的数据库 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'DbId' = example_db_id; + ``` + +2. 删除 id 为 example_tbl_id 的表 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'TableId' = example_tbl_id; + ``` + +3. 删除 id 为 p1_id 的分区 + + ```sql + DROP CATALOG RECYCLE BIN WHERE 'PartitionId' = p1_id; + ``` + +### Keywords + +DROP, CATALOG, RECYCLE, BIN + +### Best Practice + diff --git a/sidebars.json b/sidebars.json index 0f741745888..394ea4ed7ca 100644 --- a/sidebars.json +++ b/sidebars.json @@ -1280,7 +1280,8 @@ "sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-SQL-BLOCK-RULE", "sql-manual/sql-statements/Data-Definition-Statements/Drop/TRUNCATE-TABLE", "sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-ASYNC-MATERIALIZED-VIEW", - "sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-JOB" + "sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-JOB", + "sql-manual/sql-statements/Data-Definition-Statements/Drop/DROP-CATALOG-RECYCLE-BIN" ] }, { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org