morningman commented on code in PR #16483: URL: https://github.com/apache/doris/pull/16483#discussion_r1101221897
########## docs/zh-CN/docs/data-operate/import/import-way/mysql-load-manual.md: ########## @@ -0,0 +1,119 @@ +--- +{ + "title": "MySql load", + "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. +--> + +<version since="dev"></version> Review Comment: 这个要包裹文字,不是直接写。 参考:docs/zh-CN/docs/lakehouse/multi-catalog/multi-catalog.md ########## docs/zh-CN/docs/data-operate/import/import-way/mysql-load-manual.md: ########## @@ -0,0 +1,119 @@ +--- +{ + "title": "MySql load", + "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. +--> + +<version since="dev"></version> + +# MySql load + +MySql load 是SQL交互的导入方式,用户通过SQL命令将客户端本地或者服务端本地的数据导入Doris 中。 Review Comment: 该语句兼容 MySQL 标准 [LOAD DATA](https://dev.mysql.com/doc/refman/8.0/en/load-data.html) 语法,方便用户导入本地数据,并降低学习成本。 ########## docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MYSQL-LOAD.md: ########## @@ -0,0 +1,169 @@ +--- +{ + "title": "MYSQL-LOAD", + "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. +--> + +<version since="dev"></version> + +## MYSQL-LOAD + +### Name + +MYSQL LOAD Review Comment: ```suggestion <version since="dev"> MYSQL LOAD </version> ``` ########## docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MYSQL-LOAD.md: ########## @@ -0,0 +1,169 @@ +--- +{ + "title": "MYSQL-LOAD", + "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. +--> + +<version since="dev"></version> + +## MYSQL-LOAD + +### Name + +MYSQL LOAD + +### Description + +mysql-load: 使用MySql客户端导入本地数据 + +``` +LOAD DATA +[LOCAL] +INFILE 'file_name' +INTO TABLE tbl_name +[PARTITION (partition_name [, partition_name] ...)] +[COLUMNS TERMINATED BY 'string'] +[LINES TERMINATED BY 'string'] +[IGNORE number {LINES | ROWS}] +[(col_name_or_user_var [, col_name_or_user_var] ...)] +[SET (col_name={expr | DEFAULT} [, col_name={expr | DEFAULT}] ...)] +[PROPERTIES (key1 = value1 [, key2=value2]) ] +``` + +该语句用于向指定的 table 导入数据,与普通Load区别是,这种导入方式是同步导入。 + +这种导入方式仍然能够保证一批导入任务的原子性,要么全部数据导入成功,要么全部失败。 + +1. MySQL Load以语法`LOAD DATA`开头, 无须指定LABEL +2. 指定`LOCAL`表示读取客户端文件.不指定表示读取FE服务端本地文件 +3. `INFILE`内填写本地文件路径, 可以是相对路径, 也可以是绝对路径.目前只支持单个文件, 不支持多个文件 +4. `INTO TABLE`的表名可以指定数据库名, 如案例所示. 也可以省略, 则会使用当前用户所在的数据库. +5. `PARTITION`语法支持指定分区导入 +6. `COLUMNS TERMINATED BY`指定列分隔符 +7. `LINES TERMINATED BY`指定行分隔符 +8. `IGNORE num LINES`用户跳过CSV的表头, 可以跳过任意行数. 该语法也可以用`IGNORE num ROWS`代替 +9. 列映射语法, 具体参数详见[导入的数据转换](../../../data-operate/import/import-way/mysql-load-manual.md) 的列映射章节 +10. `PROPERTIES`参数配置, 详见下文 + +### PROPERTIES + +1. max_filter_ratio:最大容忍可过滤(数据不规范等原因)的数据比例。默认零容忍。 Review Comment: ```suggestion 1. `max_filter_ratio`:最大容忍可过滤(数据不规范等原因)的数据比例。默认零容忍。 ``` Same for other properties ########## docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MYSQL-LOAD.md: ########## @@ -0,0 +1,169 @@ +--- +{ + "title": "MYSQL-LOAD", + "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. +--> + +<version since="dev"></version> + +## MYSQL-LOAD + +### Name + +MYSQL LOAD + +### Description + +mysql-load: 使用MySql客户端导入本地数据 + +``` +LOAD DATA +[LOCAL] +INFILE 'file_name' +INTO TABLE tbl_name +[PARTITION (partition_name [, partition_name] ...)] +[COLUMNS TERMINATED BY 'string'] +[LINES TERMINATED BY 'string'] +[IGNORE number {LINES | ROWS}] +[(col_name_or_user_var [, col_name_or_user_var] ...)] +[SET (col_name={expr | DEFAULT} [, col_name={expr | DEFAULT}] ...)] +[PROPERTIES (key1 = value1 [, key2=value2]) ] +``` + +该语句用于向指定的 table 导入数据,与普通Load区别是,这种导入方式是同步导入。 + +这种导入方式仍然能够保证一批导入任务的原子性,要么全部数据导入成功,要么全部失败。 + +1. MySQL Load以语法`LOAD DATA`开头, 无须指定LABEL +2. 指定`LOCAL`表示读取客户端文件.不指定表示读取FE服务端本地文件 +3. `INFILE`内填写本地文件路径, 可以是相对路径, 也可以是绝对路径.目前只支持单个文件, 不支持多个文件 +4. `INTO TABLE`的表名可以指定数据库名, 如案例所示. 也可以省略, 则会使用当前用户所在的数据库. +5. `PARTITION`语法支持指定分区导入 +6. `COLUMNS TERMINATED BY`指定列分隔符 +7. `LINES TERMINATED BY`指定行分隔符 +8. `IGNORE num LINES`用户跳过CSV的表头, 可以跳过任意行数. 该语法也可以用`IGNORE num ROWS`代替 +9. 列映射语法, 具体参数详见[导入的数据转换](../../../data-operate/import/import-way/mysql-load-manual.md) 的列映射章节 +10. `PROPERTIES`参数配置, 详见下文 + +### PROPERTIES + +1. max_filter_ratio:最大容忍可过滤(数据不规范等原因)的数据比例。默认零容忍。 + +2. timeout: 指定导入的超时时间。单位秒。默认是 600 秒。可设置范围为 1 秒 ~ 259200 秒。 + +3. strict_mode: 用户指定此次导入是否开启严格模式,默认为关闭。 + +4. timezone: 指定本次导入所使用的时区。默认为东八区。该参数会影响所有导入涉及的和时区有关的函数结果。 + +5. exec_mem_limit: 导入内存限制。默认为 2GB。单位为字节。 + +### Example + +1. 将客户端本地文件'testData'中的数据导入到数据库'testDb'中'testTbl'的表。指定超时时间为 100 秒 + + ```sql + LOAD DATA LOCAL + INFILE 'testData' + INTO TABLE testDb.testTbl + PROPERTIES ("timeout"="100") + ``` + +2. 将服务端本地文件'/root/testData'中的数据导入到数据库'testDb'中'testTbl'的表。指定超时时间为 100 秒 + + ```sql Review Comment: Use same indent level for all example ########## docs/zh-CN/docs/sql-manual/sql-reference/Data-Manipulation-Statements/Load/MYSQL-LOAD.md: ########## @@ -0,0 +1,169 @@ +--- +{ + "title": "MYSQL-LOAD", + "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. +--> + +<version since="dev"></version> + +## MYSQL-LOAD + +### Name + +MYSQL LOAD + +### Description + +mysql-load: 使用MySql客户端导入本地数据 + +``` +LOAD DATA +[LOCAL] +INFILE 'file_name' +INTO TABLE tbl_name +[PARTITION (partition_name [, partition_name] ...)] +[COLUMNS TERMINATED BY 'string'] +[LINES TERMINATED BY 'string'] +[IGNORE number {LINES | ROWS}] +[(col_name_or_user_var [, col_name_or_user_var] ...)] +[SET (col_name={expr | DEFAULT} [, col_name={expr | DEFAULT}] ...)] +[PROPERTIES (key1 = value1 [, key2=value2]) ] +``` + +该语句用于向指定的 table 导入数据,与普通Load区别是,这种导入方式是同步导入。 + +这种导入方式仍然能够保证一批导入任务的原子性,要么全部数据导入成功,要么全部失败。 + +1. MySQL Load以语法`LOAD DATA`开头, 无须指定LABEL +2. 指定`LOCAL`表示读取客户端文件.不指定表示读取FE服务端本地文件 +3. `INFILE`内填写本地文件路径, 可以是相对路径, 也可以是绝对路径.目前只支持单个文件, 不支持多个文件 +4. `INTO TABLE`的表名可以指定数据库名, 如案例所示. 也可以省略, 则会使用当前用户所在的数据库. +5. `PARTITION`语法支持指定分区导入 +6. `COLUMNS TERMINATED BY`指定列分隔符 +7. `LINES TERMINATED BY`指定行分隔符 +8. `IGNORE num LINES`用户跳过CSV的表头, 可以跳过任意行数. 该语法也可以用`IGNORE num ROWS`代替 +9. 列映射语法, 具体参数详见[导入的数据转换](../../../data-operate/import/import-way/mysql-load-manual.md) 的列映射章节 +10. `PROPERTIES`参数配置, 详见下文 + +### PROPERTIES + +1. max_filter_ratio:最大容忍可过滤(数据不规范等原因)的数据比例。默认零容忍。 + +2. timeout: 指定导入的超时时间。单位秒。默认是 600 秒。可设置范围为 1 秒 ~ 259200 秒。 + +3. strict_mode: 用户指定此次导入是否开启严格模式,默认为关闭。 + +4. timezone: 指定本次导入所使用的时区。默认为东八区。该参数会影响所有导入涉及的和时区有关的函数结果。 + +5. exec_mem_limit: 导入内存限制。默认为 2GB。单位为字节。 + +### Example + +1. 将客户端本地文件'testData'中的数据导入到数据库'testDb'中'testTbl'的表。指定超时时间为 100 秒 + + ```sql + LOAD DATA LOCAL + INFILE 'testData' + INTO TABLE testDb.testTbl + PROPERTIES ("timeout"="100") + ``` + +2. 将服务端本地文件'/root/testData'中的数据导入到数据库'testDb'中'testTbl'的表。指定超时时间为 100 秒 Review Comment: Rewrite this example when fixing the security issue -- 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. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org