You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/10/04 02:23:50 UTC

[GitHub] [incubator-doris] morningman commented on a change in pull request #4669: [Feature] Support REPLACE TABLE operation.

morningman commented on a change in pull request #4669:
URL: https://github.com/apache/incubator-doris/pull/4669#discussion_r499198617



##########
File path: docs/zh-CN/administrator-guide/alter-table/alter-table-replace-table.md
##########
@@ -0,0 +1,73 @@
+---
+{
+    "title": "替换表",
+    "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.
+-->
+
+# 替换表
+
+在 0.14 版本中,Doris 支持对两个表进行原子的替换操作。
+该操作仅适用于 OLAP 表。
+
+分区级别的替换操作,请参阅 [临时分区文档](./alter-table-temp-partition.md)
+
+## 语法说明
+
+```
+ALTER TABLE [db.]tbl1 REPLACE WITH tbl2
+[PROPERTIES('swap' = 'true')];
+```
+
+将表 tbl1 替换为表 tbl2。
+
+如果 `swap` 参数为 `true`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表中的数据为原 `tbl1` 表中的数据。即两张表数据发生了互换。
+
+如果 `swap` 参数为 `true`,则替换后,名称为 `tbl1` 表中的数据为原 `tbl2` 表中的数据。而名称为 `tbl2` 表被删除。 

Review comment:
       fixed

##########
File path: docs/en/administrator-guide/alter-table/alter-table-replace-table.md
##########
@@ -0,0 +1,72 @@
+---
+{
+    "title": "Replace Table",
+    "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.
+-->
+
+# Replace Table
+
+In version 0.14, Doris supports atomic replacement of two tables.
+This operation only applies to OLAP tables.
+
+For partition level replacement operations, please refer to [Temporary Partition Document](./alter-table-temp-partition.md)
+
+## Syntax
+
+```
+ALTER TABLE [db.]tbl1 REPLACE WITH tbl2
+[PROPERTIES('swap' = 'true')];
+```
+
+Replace table `tbl1` with table `tbl2`.
+
+If the `swap` parameter is `true`, after replacement, the data in the table named `tbl1` is the data in the original `tbl2` table. The data in the table named `tbl2` is the data in the original table `tbl1`. That is, the data of the two tables are interchanged.
+
+If the `swap` parameter is `true`, after replacement, the data in the table named `tbl1` is the data in the original `tbl2` table. The table named `tbl2` is dropped.

Review comment:
       fixed




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org