brantyou commented on issue #64806:
URL: https://github.com/apache/doris/issues/64806#issuecomment-4795564994
TVF mode sql:
```
CREATE DATABASE IF NOT EXISTS lake_ods_test;
CREATE TABLE IF NOT EXISTS `lake_ods_test`.`ods_dkt_table` (
`id` char(32) NOT NULL COMMENT '主键ID',
`order_code` char(15) NOT NULL COMMENT '单号',
`type` varchar(50) NOT NULL COMMENT '类型,中文',
`remark` varchar(500) DEFAULT NULL COMMENT '补充说明',
`created_on` datetime(3) NOT NULL COMMENT '创建时间',
`updated_on` datetime(3) NOT NULL COMMENT '更新时间',
`created_by` varchar(30) NOT NULL COMMENT '创建人',
`updated_by` varchar(30) NOT NULL COMMENT '更新人',
`version` int(11) NOT NULL DEFAULT '1' COMMENT '版本号'
)
DUPLICATE KEY(id, order_code,)
DISTRIBUTED BY HASH(id) BUCKETS 10
PROPERTIES( "replication_allocation" = "tag.location.default: 1")
;
CREATE JOB mysql_sync_ods_dkt_table
ON STREAMING
DO
INSERT INTO `lake_ods_test`.`ods_dkt_table`
SELECT
id,
order_code,
type,
remark,
created_on,
updated_on,
created_by,
updated_by,
version
FROM cdc_stream(
"type" = "mysql",
"jdbc_url" = "jdbc:mysql://127.0.0.1:3306",
"driver_url" =
"https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver",
"user" = "username",
"password" = "password",
"database" = "test",
"table" = "test_table",
"offset" = "initial"
)
;
```
CDC mode sql:
```
CREATE DATABASE IF NOT EXISTS lake_ods_test2;
CREATE JOB sync_db_test
ON STREAMING
FROM MYSQL(
"jdbc_url" =
"jdbc:mysql://127.0.0.1:3306?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai&zeroDateTimeBehavior=convertToNull",
"driver_url" =
"https://repo1.maven.org/maven2/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar",
"driver_class" = "com.mysql.cj.jdbc.Driver",
"user" = "username",
"password" = "password",
"database" = "test",
"include_tables" = "test_table",
"offset" = "initial"
)
TO DATABASE lake_ods_test2 (
"table.create.properties.replication_num" = "1"
)
;
```
in doris do:
```
SHOW VARIABLES LIKE 'character_set%';
```
result:
```
character_set_client utf8mb4 utf8mb4 0
character_set_connection utf8mb4 utf8mb4 0
character_set_results utf8mb4 utf8mb4 0
character_set_server utf8mb4 utf8mb4 0
```
do:
```
SHOW VARIABLES LIKE 'collation%';
```
result:
```
collation_connection utf8mb4_0900_bin utf8mb4_0900_bin 0
collation_database utf8mb4_0900_bin utf8mb4_0900_bin 0
collation_server utf8mb4_0900_bin utf8mb4_0900_bin 0
```
A source-side sample such as SELECT col, HEX(col) ... and the corresponding
Doris SELECT col, HEX(col) ....
in mysql:
```
SELECT type, HEX(type) FROM test_table WHERE id='1';
```
result:
```
挖隧道、修道路 E68C96E99AA7E98193E38081E4BFAEE98193E8B7AF
```
in doris CDC mode:
```
SELECT type, HEX(type) FROM lake_ods_test2.test_table WHERE id='1';
```
result:
```
??????? 3F3F3F3F3F3F3F
```
in doris CVT mode:
```
SELECT type, HEX(type) FROM lake_ods_test.test_table WHERE id='1';
```
result:
```
挖隧道、修道路 E68C96E99AA7E98193E38081E4BFAEE98193E8B7AF
```
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]