You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "DongLiang-0 (via GitHub)" <gi...@apache.org> on 2023/06/26 08:04:56 UTC
[GitHub] [doris-flink-connector] DongLiang-0 opened a new pull request, #152: [Improve](mysqlSync)Add the configuration of whether to synchronize the default value
DongLiang-0 opened a new pull request, #152:
URL: https://github.com/apache/doris-flink-connector/pull/152
# Proposed changes
At present, when the mysql database sync to doris , there is a default value in the field, but the actual data is null, the data cannot maintain consistency.
Like: when mysql schema has a default value and the insertion is ` null `, the data synchronized to doris uses the default value.
``` sql
CREATE TABLE `test_sink` (
`id` int NOT NULL,
`name` varchar(50) DEFAULT 'test_default',
`age` int DEFAULT '10000',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
insert into test_sink (id,name,age) values(6, null, 666);
insert into test_sink (id,name,age) values(5, 'zhaoliu', null);
```
## Problem Summary:
Describe the overview of changes.
## Checklist(Required)
1. Does it affect the original behavior: (Yes/No/I Don't know)
2. Has unit tests been added: (Yes/No/No Need)
3. Has document been added or modified: (Yes/No/No Need)
4. Does it need to update dependencies: (Yes/No)
5. Are there any changes that cannot be rolled back: (Yes/No)
## Further comments
If this is a relatively large or complex change, kick off the discussion at [dev@doris.apache.org](mailto:dev@doris.apache.org) by explaining why you chose the solution you did and what alternatives you considered, etc...
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris-flink-connector] JNSimba merged pull request #152: [Improve](mysqlSync)Add the configuration of whether to synchronize the default value
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba merged PR #152:
URL: https://github.com/apache/doris-flink-connector/pull/152
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris-flink-connector] JNSimba commented on a diff in pull request #152: [Improve](mysqlSync)Add the configuration of whether to synchronize the default value
Posted by "JNSimba (via GitHub)" <gi...@apache.org>.
JNSimba commented on code in PR #152:
URL: https://github.com/apache/doris-flink-connector/pull/152#discussion_r1246222635
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/CdcTools.java:
##########
@@ -57,6 +57,8 @@ private static void createMySQLSyncDatabase(String[] opArgs) throws Exception {
String tableSuffix = params.get("table-suffix");
String includingTables = params.get("including-tables");
String excludingTables = params.get("excluding-tables");
+ boolean ignoreDefaultValue =
+ Boolean.parseBoolean(params.get("ignore-default-value", "false"));
Review Comment:
params.has is better?
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
Re: [PR] [Improve](mysqlSync)Add the configuration of whether to synchronize the default value [doris-flink-connector]
Posted by "Memory5210 (via GitHub)" <gi...@apache.org>.
Memory5210 commented on PR #152:
URL: https://github.com/apache/doris-flink-connector/pull/152#issuecomment-2006362911
In actual testing, the parameter of ignore-default-value is not effective. Regardless of whether this parameter is present or not, the default values of MySQL fields will not be synchronized. Doris's table creation statements and data synchronized from MySQL to Doris do not have default values.
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org
[GitHub] [doris-flink-connector] DongLiang-0 commented on a diff in pull request #152: [Improve](mysqlSync)Add the configuration of whether to synchronize the default value
Posted by "DongLiang-0 (via GitHub)" <gi...@apache.org>.
DongLiang-0 commented on code in PR #152:
URL: https://github.com/apache/doris-flink-connector/pull/152#discussion_r1269200909
##########
flink-doris-connector/src/main/java/org/apache/doris/flink/tools/cdc/CdcTools.java:
##########
@@ -57,6 +57,8 @@ private static void createMySQLSyncDatabase(String[] opArgs) throws Exception {
String tableSuffix = params.get("table-suffix");
String includingTables = params.get("including-tables");
String excludingTables = params.get("excluding-tables");
+ boolean ignoreDefaultValue =
+ Boolean.parseBoolean(params.get("ignore-default-value", "false"));
Review Comment:
Thanks for your suggestion, I have fixed it.
--
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@doris.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org