From a8c0e6a12ba7955ff5488e82f6183f0a1bb45c50 Mon Sep 17 00:00:00 2001 From: cnmade Date: Sun, 30 Jan 2022 14:49:40 +0800 Subject: [PATCH 1/4] Translate zh/sql-reference/statements/truncate: rename old file --- docs/zh/sql-reference/statements/{truncate.md => truncate.md.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/zh/sql-reference/statements/{truncate.md => truncate.md.bak} (100%) diff --git a/docs/zh/sql-reference/statements/truncate.md b/docs/zh/sql-reference/statements/truncate.md.bak similarity index 100% rename from docs/zh/sql-reference/statements/truncate.md rename to docs/zh/sql-reference/statements/truncate.md.bak From ad6dfcc614bfe1b86dc34bc3ed4dcf11489b5b6d Mon Sep 17 00:00:00 2001 From: cnmade Date: Sun, 30 Jan 2022 14:51:56 +0800 Subject: [PATCH 2/4] Translate zh/sql-reference/statements/truncate: reimport file --- docs/zh/sql-reference/statements/truncate.md | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 docs/zh/sql-reference/statements/truncate.md diff --git a/docs/zh/sql-reference/statements/truncate.md b/docs/zh/sql-reference/statements/truncate.md new file mode 100644 index 00000000000..b5354196fa4 --- /dev/null +++ b/docs/zh/sql-reference/statements/truncate.md @@ -0,0 +1,21 @@ +--- +toc_priority: 52 +toc_title: TRUNCATE +--- + +# TRUNCATE Statement {#truncate-statement} + +``` sql +TRUNCATE TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] +``` + +Removes all data from a table. When the clause `IF EXISTS` is omitted, the query returns an error if the table does not exist. + +The `TRUNCATE` query is not supported for [View](../../engines/table-engines/special/view.md), [File](../../engines/table-engines/special/file.md), [URL](../../engines/table-engines/special/url.md), [Buffer](../../engines/table-engines/special/buffer.md) and [Null](../../engines/table-engines/special/null.md) table engines. + +You can use the [replication_alter_partitions_sync](../../operations/settings/settings.md#replication-alter-partitions-sync) setting to set up waiting for actions to be executed on replicas. + +You can specify how long (in seconds) to wait for inactive replicas to execute `TRUNCATE` queries with the [replication_wait_for_inactive_replica_timeout](../../operations/settings/settings.md#replication-wait-for-inactive-replica-timeout) setting. + +!!! info "Note" + If the `replication_alter_partitions_sync` is set to `2` and some replicas are not active for more than the time, specified by the `replication_wait_for_inactive_replica_timeout` setting, then an exception `UNFINISHED` is thrown. From b1867fc1e3004a79faa107014ae364f8bc0287de Mon Sep 17 00:00:00 2001 From: cnmade Date: Sun, 30 Jan 2022 14:57:40 +0800 Subject: [PATCH 3/4] Translate zh/sql-reference/statements/truncate: translate to zh --- docs/zh/sql-reference/statements/truncate.md | 24 ++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/zh/sql-reference/statements/truncate.md b/docs/zh/sql-reference/statements/truncate.md index b5354196fa4..f827bc201d3 100644 --- a/docs/zh/sql-reference/statements/truncate.md +++ b/docs/zh/sql-reference/statements/truncate.md @@ -3,19 +3,29 @@ toc_priority: 52 toc_title: TRUNCATE --- -# TRUNCATE Statement {#truncate-statement} +# TRUNCATE 语句 {#truncate-statement} ``` sql TRUNCATE TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster] ``` -Removes all data from a table. When the clause `IF EXISTS` is omitted, the query returns an error if the table does not exist. +删除表中的所有数据。当省略子句 `IF EXISTS` 时,如果表不存在,则查询返回一个错误。 -The `TRUNCATE` query is not supported for [View](../../engines/table-engines/special/view.md), [File](../../engines/table-engines/special/file.md), [URL](../../engines/table-engines/special/url.md), [Buffer](../../engines/table-engines/special/buffer.md) and [Null](../../engines/table-engines/special/null.md) table engines. -You can use the [replication_alter_partitions_sync](../../operations/settings/settings.md#replication-alter-partitions-sync) setting to set up waiting for actions to be executed on replicas. -You can specify how long (in seconds) to wait for inactive replicas to execute `TRUNCATE` queries with the [replication_wait_for_inactive_replica_timeout](../../operations/settings/settings.md#replication-wait-for-inactive-replica-timeout) setting. +`TRUNCATE` 查询不支持[View](../../engines/table-engines/special/view.md),[File](../../engines/table-engines/special/file.md), [URL](../../engines/table-engines/special/url.md), [Buffer](../../engines/table-engines/special/buffer.md) 和 [Null](../../engines/table-engines/special/null.md)表引擎。 + + + +可以使用[replication_alter_partitions_sync](../../operations/settings/settings.md#replication-alter-partitions-sync)设置在复制集上等待执行的操作。 + + + +通过 [replication_wait_for_inactive_replica_timeout](../../operations/settings/settings.md#replication-wait-for-inactive-replica-timeout) 设置,可以指定不活动副本执行 `TRUNCATE`查询需要等待多长时间(以秒为单位)。 + + + +!!! info "注意" + 如果`replication_alter_partitions_sync` 被设置为`2`,并且某些复制集超过 `replication_wait_for_inactive_replica_timeout`设置的时间不激活,那么将抛出一个异常`UNFINISHED`。 + -!!! info "Note" - If the `replication_alter_partitions_sync` is set to `2` and some replicas are not active for more than the time, specified by the `replication_wait_for_inactive_replica_timeout` setting, then an exception `UNFINISHED` is thrown. From ef5de6734856dd342befcd736dd1b01d045f7e05 Mon Sep 17 00:00:00 2001 From: cnmade Date: Sun, 30 Jan 2022 14:58:55 +0800 Subject: [PATCH 4/4] Translate zh/sql-reference/statements/truncate: remove old file --- docs/zh/sql-reference/statements/truncate.md.bak | 1 - 1 file changed, 1 deletion(-) delete mode 120000 docs/zh/sql-reference/statements/truncate.md.bak diff --git a/docs/zh/sql-reference/statements/truncate.md.bak b/docs/zh/sql-reference/statements/truncate.md.bak deleted file mode 120000 index 92fbd705e8f..00000000000 --- a/docs/zh/sql-reference/statements/truncate.md.bak +++ /dev/null @@ -1 +0,0 @@ -../../../en/sql-reference/statements/truncate.md \ No newline at end of file