You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by GitBox <gi...@apache.org> on 2022/11/06 12:53:24 UTC

[GitHub] [inlong-website] kuansix opened a new pull request, #586: [INLONG-585] add multi sink doris doc

kuansix opened a new pull request, #586:
URL: https://github.com/apache/inlong-website/pull/586

   ### Prepare a Pull Request
   
   - Title Example: [INLONG-585][Component] Title of the pull request
   
   - Fixes #585 
   
   ### Motivation
   
   *Explain here the context, and why you're making that change. What is the problem you're trying to solve.*
   
   ### Modifications
   
   *Describe the modifications you've done.*
   
   ### Verifying this change
   
   - [ ] Make sure that the change passes the CI checks.
   
   *(Please pick either of the following options)*
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This change is already covered by existing tests, such as *(please describe tests)*.
   
   *(or)*
   
   This change added tests and can be verified as follows:
   
   *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? (yes / no)
     - If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
     - If a feature is not applicable for documentation, explain why?
     - If a feature is not documented yet in this PR, please create a followup issue for adding the documentation
   


-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] yunqingmoswu commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1015161522


##########
docs/data_node/load_node/doris.md:
##########
@@ -6,9 +6,11 @@ sidebar_position: 16
 import {siteVariables} from '../../version';
 
 ## Overview
-
-The `Doris Load` node supports writing data to the Doris database. This document describes how to set up a
-Doris Load node to run SQL queries against the Doris database.
+ - `Doris Load` node supports writing data to the Doris database.
+ - Two modes are supported for sink to Doris: 
+Single-sink for specify fixed database name and table name to sink. 
+Multi-sink for custom database name and table name according to src format, which suitable for scenarios such as multi-table writing or whole database synchronization.

Review Comment:
   synchronization -> writing



##########
docs/data_node/load_node/doris.md:
##########
@@ -59,18 +61,65 @@ mysql> select * from cdc_mysql_source;
 |  2 | lisi     |  0 |
 |  3 | wangwu   |  0 |
 +----+----------+----+
-3 rows in set (0.07 sec)     
+3 rows in set (0.07 sec)
+```
+##### 2.create tables `user_db.user_id_name`、`user_db.user_id_name` in the MySql database for multi-sink extract. the command is as follows:

Review Comment:
   MySql -> MySQL



##########
docs/data_node/load_node/doris.md:
##########
@@ -59,18 +61,65 @@ mysql> select * from cdc_mysql_source;
 |  2 | lisi     |  0 |
 |  3 | wangwu   |  0 |
 +----+----------+----+
-3 rows in set (0.07 sec)     
+3 rows in set (0.07 sec)
+```
+##### 2.create tables `user_db.user_id_name`、`user_db.user_id_name` in the MySql database for multi-sink extract. the command is as follows:

Review Comment:
   create tables -> Create tables



##########
docs/data_node/load_node/doris.md:
##########
@@ -33,11 +35,11 @@ such as Maven or SBT is provided below.
 </code></pre>
 
 ## Prepare
-### Create a MySql Extract table
-First create a table `cdc_mysql_source` in the MySql database, the command is as follows:
+### Create MySql Extract table
+##### 1.create a table `cdc.cdc_mysql_source` in the MySql database for single-sink extract. the command is as follows:

Review Comment:
   The first letter should be upper for the first word.



##########
docs/data_node/load_node/doris.md:
##########
@@ -134,7 +215,54 @@ Flink SQL> insert into cdc_doris_sink select * from cdc_mysql_source /*+ OPTIONS
 [INFO] Submitting SQL update statement to the cluster...
 [INFO] SQL update statement has been successfully submitted to the cluster:
 Job ID: 5f89691571d7b3f3ca446589e3d0c3d3
+```
+##### 2.doris multi-sink load
+```sql
+./bin/sql-client.sh -l ./opt/connectors/mysql-cdc-inlong/ -l ./opt/connectors/doris/
+Flink SQL> SET 'execution.checkpointing.interval' = '3s';
+[INFO] Session property has been set.
+
+Flink SQL> SET 'table.dynamic-table-options.enabled' = 'true';
+[INFO] Session property has been set.
+
+Flink SQL> CREATE TABLE cdc_mysql_source (
+    >   id int
+    >   ,name VARCHAR
+    >   ,dr TINYINT
+    >   ,PRIMARY KEY (id) NOT ENFORCED
+    > ) WITH (
+    >  'connector' = 'mysql-cdc-inlong',
+    >  'hostname' = 'localhost',
+    >  'port' = '3306',
+    >  'username' = 'root',
+    >  'password' = '123456',
+    >  'database-name' = 'test',
+    >  'table-name' = 'cdc_mysql_source'
+    > );
+[INFO] Execute statement succeed.
 
+Flink SQL> CREATE TABLE cdc_doris_sink (
+    > id INT,
+    > name STRING,
+    > dr TINYINT
+    > ) WITH (
+    >  'connector' = 'doris-inlong',
+    >  'fenodes' = 'localhost:8030',
+    >  'username' = 'root',
+    >  'password' = '000000',
+    >  'sink.enable-delete' = 'true',
+    >  'sink.multiple.enable' = 'true',
+    >  'sink.multiple.format' = 'canal-json',
+    >  'sink.multiple.database-pattern' = '${database}',
+    >  'sink.multiple.table-pattern' = 'doris_${table}'
+    > );
+[INFO] Execute statement succeed.
+
+-- 支持删除事件同步(sink.enable-delete='true'), 需要 Doris 表开启批量删除功能

Review Comment:
   It is required to translate.



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] EMsnap merged pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
EMsnap merged PR #586:
URL: https://github.com/apache/inlong-website/pull/586


-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] kuansix commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1015394451


##########
docs/data_node/load_node/doris.md:
##########
@@ -6,9 +6,11 @@ sidebar_position: 16
 import {siteVariables} from '../../version';
 
 ## Overview
-
-The `Doris Load` node supports writing data to the Doris database. This document describes how to set up a
-Doris Load node to run SQL queries against the Doris database.
+ - `Doris Load` node supports writing data to the Doris database.
+ - Two modes are supported for sink to Doris: 
+Single-sink for specify fixed database name and table name to sink. 
+Multi-sink for custom database name and table name according to src format, which suitable for scenarios such as multi-table writing or whole database synchronization.

Review Comment:
   synchronization is OK?



##########
docs/data_node/load_node/doris.md:
##########
@@ -134,7 +215,54 @@ Flink SQL> insert into cdc_doris_sink select * from cdc_mysql_source /*+ OPTIONS
 [INFO] Submitting SQL update statement to the cluster...
 [INFO] SQL update statement has been successfully submitted to the cluster:
 Job ID: 5f89691571d7b3f3ca446589e3d0c3d3
+```
+##### 2.doris multi-sink load
+```sql
+./bin/sql-client.sh -l ./opt/connectors/mysql-cdc-inlong/ -l ./opt/connectors/doris/
+Flink SQL> SET 'execution.checkpointing.interval' = '3s';
+[INFO] Session property has been set.
+
+Flink SQL> SET 'table.dynamic-table-options.enabled' = 'true';
+[INFO] Session property has been set.
+
+Flink SQL> CREATE TABLE cdc_mysql_source (
+    >   id int
+    >   ,name VARCHAR
+    >   ,dr TINYINT
+    >   ,PRIMARY KEY (id) NOT ENFORCED
+    > ) WITH (
+    >  'connector' = 'mysql-cdc-inlong',
+    >  'hostname' = 'localhost',
+    >  'port' = '3306',
+    >  'username' = 'root',
+    >  'password' = '123456',
+    >  'database-name' = 'test',
+    >  'table-name' = 'cdc_mysql_source'
+    > );
+[INFO] Execute statement succeed.
 
+Flink SQL> CREATE TABLE cdc_doris_sink (
+    > id INT,
+    > name STRING,
+    > dr TINYINT
+    > ) WITH (
+    >  'connector' = 'doris-inlong',
+    >  'fenodes' = 'localhost:8030',
+    >  'username' = 'root',
+    >  'password' = '000000',
+    >  'sink.enable-delete' = 'true',
+    >  'sink.multiple.enable' = 'true',
+    >  'sink.multiple.format' = 'canal-json',
+    >  'sink.multiple.database-pattern' = '${database}',
+    >  'sink.multiple.table-pattern' = 'doris_${table}'
+    > );
+[INFO] Execute statement succeed.
+
+-- 支持删除事件同步(sink.enable-delete='true'), 需要 Doris 表开启批量删除功能

Review Comment:
   done



##########
docs/data_node/load_node/doris.md:
##########
@@ -59,18 +61,65 @@ mysql> select * from cdc_mysql_source;
 |  2 | lisi     |  0 |
 |  3 | wangwu   |  0 |
 +----+----------+----+
-3 rows in set (0.07 sec)     
+3 rows in set (0.07 sec)
+```
+##### 2.create tables `user_db.user_id_name`、`user_db.user_id_name` in the MySql database for multi-sink extract. the command is as follows:

Review Comment:
   done



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] yunqingmoswu commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1016100838


##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -82,11 +131,43 @@ mysql> CREATE TABLE `cdc_doris_sink` (
        );
 Query OK, 0 rows affected (0.06 sec)
 ```
+- 多表写入:在 Doris `user_db`数据库中创建表`doris_user_id_name`、`doris_user_id_score`。命令如下:
+```sql
+[root@fe001 ~]# mysql -u root -h localhost -P 9030 -p000000
+mysql> use user_db;
+Reading table information for completion of table and column names
+You can turn off this feature to get a quicker startup with -A
+Database changed
+
+mysql> CREATE TABLE `doris_user_id_name` (
+       `id` int(11) NOT NULL COMMENT "用户id",
+       `name` varchar(50) NOT NULL COMMENT "昵称"
+       ) ENGINE=OLAP
+       UNIQUE KEY(`id`)
+       COMMENT "OLAP"
+       DISTRIBUTED BY HASH(`id`) BUCKETS 1
+       PROPERTIES (
+       "replication_allocation" = "tag.location.default: 1"
+       );
+Query OK, 0 rows affected (0.06 sec)
+
+mysql> CREATE TABLE `doris_user_id_score` (
+       `id` int(11) NOT NULL COMMENT "用户id",
+       `score` double default 0
+       ) ENGINE=OLAP
+       UNIQUE KEY(`id`)
+       COMMENT "OLAP"
+       DISTRIBUTED BY HASH(`id`) BUCKETS 1
+       PROPERTIES (
+       "replication_allocation" = "tag.location.default: 1"
+       );
+Query OK, 0 rows affected (0.06 sec)
+```
 
 ## 如何创建 Doris Load 节点
 
 ### SQL API 用法
-
+- 单表写入:doris单表写入

Review Comment:
   中英文用空格隔开,首字母大写



##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -168,6 +296,13 @@ TODO: 将在未来支持此功能。
 | sink.batch.interval               | 可选   | 10s               | string   | Flush 间隔时间,超过该时间后异步线程将缓存中数据写入 BE。 默认值为10秒,支持时间单位 ms、s、min、h和d。设置为0表示关闭定期写入。                                                                                                                                                                                                                            |
 | sink.properties.*                 | 可选   | (none)            | string   | Stream load 的导入参数<br /><br />例如:<br />'sink.properties.column_separator' = ', '<br />定义列分隔符<br /><br />'sink.properties.escape_delimiters' = 'true'<br />特殊字符作为分隔符,'\\x01'会被转换为二进制的0x01<br /><br /> 'sink.properties.format' = 'json'<br />'sink.properties.strip_outer_array' = 'true' <br />JSON格式导入 |
 | sink.enable-delete                | 可选   | true              | boolean  | 是否启用删除。此选项需要 Doris 表开启批量删除功能(0.15+版本默认开启),只支持 Uniq 模型。                                                                                                                                                                                                                                                 |
+| sink.enable-delete                | 可选   | true              | boolean  | 是否启用删除。此选项需要 Doris 表开启批量删除功能(0.15+版本默认开启),只支持 Uniq 模型。                                                                                                                                                                                                                                                 |
+| sink.multiple.enable              | 可选   | false             | boolean  | 是否支持Doris多表写入。`sink.multiple.enable`为`true`时,需要`sink.multiple.format`、`sink.multiple.database-pattern`、`sink.multiple.table-pattern` 分别设置正确的值。        |

Review Comment:
   中英文用空格隔开



##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -132,7 +212,55 @@ Flink SQL> insert into cdc_doris_sink select * from cdc_mysql_source /*+ OPTIONS
 [INFO] Submitting SQL update statement to the cluster...
 [INFO] SQL update statement has been successfully submitted to the cluster:
 Job ID: 5f89691571d7b3f3ca446589e3d0c3d3
+```
+
+- 多表写入:doris多表写入

Review Comment:
   中英文用空格隔开,首字母大写



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] kuansix commented on pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
kuansix commented on PR #586:
URL: https://github.com/apache/inlong-website/pull/586#issuecomment-1306578855

   > It is recommend to add describe for the whole migiration.
   
   For Doris sink, whole migration is same with multi-sink. Maybe it is necessary to describe in the source doc?


-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] kuansix commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1015394942


##########
docs/data_node/load_node/doris.md:
##########
@@ -33,11 +35,11 @@ such as Maven or SBT is provided below.
 </code></pre>
 
 ## Prepare
-### Create a MySql Extract table
-First create a table `cdc_mysql_source` in the MySql database, the command is as follows:
+### Create MySql Extract table
+##### 1.create a table `cdc.cdc_mysql_source` in the MySql database for single-sink extract. the command is as follows:

Review Comment:
   done



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] kuansix commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
kuansix commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1016107530


##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -82,11 +131,43 @@ mysql> CREATE TABLE `cdc_doris_sink` (
        );
 Query OK, 0 rows affected (0.06 sec)
 ```
+- 多表写入:在 Doris `user_db`数据库中创建表`doris_user_id_name`、`doris_user_id_score`。命令如下:
+```sql
+[root@fe001 ~]# mysql -u root -h localhost -P 9030 -p000000
+mysql> use user_db;
+Reading table information for completion of table and column names
+You can turn off this feature to get a quicker startup with -A
+Database changed
+
+mysql> CREATE TABLE `doris_user_id_name` (
+       `id` int(11) NOT NULL COMMENT "用户id",
+       `name` varchar(50) NOT NULL COMMENT "昵称"
+       ) ENGINE=OLAP
+       UNIQUE KEY(`id`)
+       COMMENT "OLAP"
+       DISTRIBUTED BY HASH(`id`) BUCKETS 1
+       PROPERTIES (
+       "replication_allocation" = "tag.location.default: 1"
+       );
+Query OK, 0 rows affected (0.06 sec)
+
+mysql> CREATE TABLE `doris_user_id_score` (
+       `id` int(11) NOT NULL COMMENT "用户id",
+       `score` double default 0
+       ) ENGINE=OLAP
+       UNIQUE KEY(`id`)
+       COMMENT "OLAP"
+       DISTRIBUTED BY HASH(`id`) BUCKETS 1
+       PROPERTIES (
+       "replication_allocation" = "tag.location.default: 1"
+       );
+Query OK, 0 rows affected (0.06 sec)
+```
 
 ## 如何创建 Doris Load 节点
 
 ### SQL API 用法
-
+- 单表写入:doris单表写入

Review Comment:
   done



##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -132,7 +212,55 @@ Flink SQL> insert into cdc_doris_sink select * from cdc_mysql_source /*+ OPTIONS
 [INFO] Submitting SQL update statement to the cluster...
 [INFO] SQL update statement has been successfully submitted to the cluster:
 Job ID: 5f89691571d7b3f3ca446589e3d0c3d3
+```
+
+- 多表写入:doris多表写入

Review Comment:
   done



##########
i18n/zh-CN/docusaurus-plugin-content-docs/current/data_node/load_node/doris.md:
##########
@@ -168,6 +296,13 @@ TODO: 将在未来支持此功能。
 | sink.batch.interval               | 可选   | 10s               | string   | Flush 间隔时间,超过该时间后异步线程将缓存中数据写入 BE。 默认值为10秒,支持时间单位 ms、s、min、h和d。设置为0表示关闭定期写入。                                                                                                                                                                                                                            |
 | sink.properties.*                 | 可选   | (none)            | string   | Stream load 的导入参数<br /><br />例如:<br />'sink.properties.column_separator' = ', '<br />定义列分隔符<br /><br />'sink.properties.escape_delimiters' = 'true'<br />特殊字符作为分隔符,'\\x01'会被转换为二进制的0x01<br /><br /> 'sink.properties.format' = 'json'<br />'sink.properties.strip_outer_array' = 'true' <br />JSON格式导入 |
 | sink.enable-delete                | 可选   | true              | boolean  | 是否启用删除。此选项需要 Doris 表开启批量删除功能(0.15+版本默认开启),只支持 Uniq 模型。                                                                                                                                                                                                                                                 |
+| sink.enable-delete                | 可选   | true              | boolean  | 是否启用删除。此选项需要 Doris 表开启批量删除功能(0.15+版本默认开启),只支持 Uniq 模型。                                                                                                                                                                                                                                                 |
+| sink.multiple.enable              | 可选   | false             | boolean  | 是否支持Doris多表写入。`sink.multiple.enable`为`true`时,需要`sink.multiple.format`、`sink.multiple.database-pattern`、`sink.multiple.table-pattern` 分别设置正确的值。        |

Review Comment:
   done



-- 
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-unsubscribe@inlong.apache.org

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


[GitHub] [inlong-website] yunqingmoswu commented on a diff in pull request #586: [INLONG-585][Doc] Add document for multiple sink of Doris

Posted by GitBox <gi...@apache.org>.
yunqingmoswu commented on code in PR #586:
URL: https://github.com/apache/inlong-website/pull/586#discussion_r1016099873


##########
docs/data_node/load_node/doris.md:
##########
@@ -6,9 +6,11 @@ sidebar_position: 16
 import {siteVariables} from '../../version';
 
 ## Overview
-
-The `Doris Load` node supports writing data to the Doris database. This document describes how to set up a
-Doris Load node to run SQL queries against the Doris database.
+ - `Doris Load` node supports writing data to the Doris database.
+ - Two modes are supported for sink to Doris: 
+Single-sink for specify fixed database name and table name to sink. 
+Multi-sink for custom database name and table name according to src format, which suitable for scenarios such as multi-table writing or whole database synchronization.

Review Comment:
   👌



-- 
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-unsubscribe@inlong.apache.org

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