Skip to content

Commit 82eba9d

Browse files
[Doc] Add Insert with Conflicts to docs (StarRocks#48911)
1 parent a1095b3 commit 82eba9d

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

docs/en/loading/InsertInto.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ WITH LABEL insert_load_wikipedia_3
192192
SELECT event_time, channel FROM source_wiki_edit;
193193
```
194194

195+
:::note
196+
From v3.3.1, specifying a column list in the INSERT INTO statement on a Primary Key table will perform Partial Updates (instead of Full Upsert in earlier versions). If the column list is not specified, the system will perform Full Upsert.
197+
:::
198+
195199
### Insert data directly from files in an external source using FILES()
196200

197201
From v3.1 onwards, StarRocks supports directly loading data from files on cloud storage using the INSERT command and the [FILES()](../sql-reference/sql-functions/table-functions/files.md) function, thereby you do not need to create an external catalog or file external table first. Besides, FILES() can automatically infer the table schema of the files, greatly simplifying the process of data loading.

docs/en/sql-reference/sql-statements/data-manipulation/INSERT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ You can submit an asynchronous INSERT task using [SUBMIT TASK](./SUBMIT_TASK.md)
4141
| PARTITION | The partitions into which you want to load the data. You can specify multiple partitions, which must be separated by commas (,). It must be set to partitions that exist in the destination table. If you specify this parameter, the data will be inserted only into the specified partitions. If you do not specify this parameter, the data will be inserted into all partitions. |
4242
| TEMPORARY PARTITION |The name of the [temporary partition](../../../table_design/Temporary_partition.md) into which you want to load data. You can specify multiple temporary partitions, which must be separated by commas (,).|
4343
| label | The unique identification label for each data load transaction within the database. If it is not specified, the system automatically generates one for the transaction. We recommend you specify the label for the transaction. Otherwise, you cannot check the transaction status if a connection error occurs and no result is returned. You can check the transaction status via `SHOW LOAD WHERE label="label"` statement. For the naming conventions of labels, see [System Limits](../../../reference/System_limit.md). |
44-
| column_name | The name of the destination column(s) to load data in. It must be set as columns that exist in the destination table. The destination columns you specify are mapped one on one in sequence to the columns of the source table, regardless of what the destination column names are. If no destination column is specified, the default value is all columns in the destination table. If the specified column in the source table does not exist in the destination column, the default value will be written to this column, and the transaction will fail if the specified column does not have a default value. If the column type of the source table is inconsistent with that of the destination table, the system will perform an implicit conversion on the mismatched column. If the conversion fails, a syntax parsing error will be returned. |
44+
| column_name | The name of the destination column(s) to load data in. It must be set as columns that exist in the destination table. The destination columns you specify are mapped one on one in sequence to the columns of the source table, regardless of what the destination column names are. If no destination column is specified, the default value is all columns in the destination table. If the specified column in the source table does not exist in the destination column, the default value will be written to this column, and the transaction will fail if the specified column does not have a default value. If the column type of the source table is inconsistent with that of the destination table, the system will perform an implicit conversion on the mismatched column. If the conversion fails, a syntax parsing error will be returned.<br />**NOTE**<br />From v3.3.1, specifying a column list in the INSERT INTO statement on a Primary Key table will perform Partial Updates (instead of Full Upsert in earlier versions). If the column list is not specified, the system will perform Full Upsert. |
4545
| expression | Expression that assigns values to the column. |
4646
| DEFAULT | Assigns default value to the column. |
4747
| query | Query statement whose result will be loaded into the destination table. It can be any SQL statement supported by StarRocks. |

docs/zh/loading/InsertInto.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ WITH LABEL insert_load_wikipedia_3
192192
SELECT event_time, channel FROM source_wiki_edit;
193193
```
194194

195+
:::note
196+
自 v3.3.1 起,INSERT INTO 导入主键表时指定 Column List 会执行部分列更新(而在先前版本中,指定 Column List 仍然导致 Full Upsert)。如不指定 Column List,系统执行 Full Upsert。
197+
:::
198+
195199
| 参数 | 说明 |
196200
| ----------- | ------------------------------------------------------------ |
197201
| table_name | 导入数据的目标表。可以为 `db_name.table_name` 形式。 |

docs/zh/sql-reference/sql-statements/data-manipulation/INSERT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ displayed_sidebar: "Chinese"
4141
| PARTITION | 导入的目标分区。此参数必须是目标表中存在的分区,多个分区名称用逗号(,)分隔。如果指定该参数,数据只会被导入相应分区内。如果未指定,则默认将数据导入至目标表的所有分区。 |
4242
| TEMPORARY PARTITION | 指定要把数据导入哪些[临时分区](../../../table_design/Temporary_partition.md)|
4343
| label | 导入作业的标识,数据库内唯一。如果未指定,StarRocks 会自动为作业生成一个 Label。建议您指定 Label。否则,如果当前导入作业因网络错误无法返回结果,您将无法得知该导入操作是否成功。如果指定了 Label,可以通过 SQL 命令 `SHOW LOAD WHERE label="label";` 查看任务结果。关于 Label 命名要求,参见[系统限制](../../../reference/System_limit.md)|
44-
| column_name | 导入的目标列,必须是目标表中存在的列。该参数的对应关系与列名无关,但与其顺序一一对应。如果不指定目标列,默认为目标表中的所有列。如果源表中的某个列在目标列不存在,则写入默认值。如果当前列没有默认值,导入作业会失败。如果查询语句的结果列类型与目标列的类型不一致,会进行隐式转化,如果不能进行转化,那么 INSERT INTO 语句会报语法解析错误。 |
44+
| column_name | 导入的目标列,必须是目标表中存在的列。该参数的对应关系与列名无关,但与其顺序一一对应。如果不指定目标列,默认为目标表中的所有列。如果源表中的某个列在目标列不存在,则写入默认值。如果当前列没有默认值,导入作业会失败。如果查询语句的结果列类型与目标列的类型不一致,会进行隐式转化,如果不能进行转化,那么 INSERT INTO 语句会报语法解析错误。<br />**说明**<br />自 v3.3.1 起,INSERT INTO 导入主键表时指定 Column List 会执行部分列更新(而在先前版本中,指定 Column List 仍然导致 Full Upsert)。如不指定 Column List,系统执行 Full Upsert。 |
4545
| expression | 表达式,用以为对应列赋值。 |
4646
| DEFAULT | 为对应列赋予默认值。 |
4747
| query | 查询语句,查询的结果会导入至目标表中。查询语句支持任意 StarRocks 支持的 SQL 查询语法。 |

0 commit comments

Comments
 (0)