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/07 09:11:31 UTC

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

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