You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ruanhang1993 (via GitHub)" <gi...@apache.org> on 2024/11/07 10:17:48 UTC
Re: [PR] [FLINK-36408] Fix MySQL pipeline connector failed to parse FLOAT type with precision [flink-cdc]
ruanhang1993 commented on code in PR #3625:
URL: https://github.com/apache/flink-cdc/pull/3625#discussion_r1832419660
##########
flink-cdc-connect/flink-cdc-pipeline-connectors/flink-cdc-pipeline-connector-mysql/src/main/java/org/apache/flink/cdc/connectors/mysql/utils/MySqlTypeUtils.java:
##########
@@ -164,7 +165,12 @@ private static DataType convertFromColumn(Column column) {
case FLOAT:
case FLOAT_UNSIGNED:
case FLOAT_UNSIGNED_ZEROFILL:
- return DataTypes.FLOAT();
+ if (column.length() != FLOAT_LENGTH_UNSPECIFIED_FLAG) {
+ // For FLOAT types with length provided explicitly, treat it like DOUBLE
+ return DataTypes.DOUBLE();
+ } else {
+ return DataTypes.FLOAT();
+ }
Review Comment:
We should change the documents about the data type mapping.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org