- Create a table in mysql with a FLOAT data type column
- Start the debezium mysql connector with the required configuration.
- Insert data into the FLOAT datatype column in the table created.
- Check if the value entered in mysql is same as the value received by debezium-mysql-connector
We have a table that contains a column of float data type in MySQL.
CREATE TABLE customers (floatColumn float);
We've observed that floating point values in this column are not accurately captured by the debezium-mysql-connector.
INSERT INTO customers VALUES (64.1),(5.6);
SELECT * FROM Customers;
When we query the table in MySQL we can see that the original value and precision is retained in the FLOAT column but with the Debezium mysql connector we receive messages with a different precision:
According to the MySQL documentation https://dev.mysql.com/doc/refman/8.0/en/floating-point-types.html FLOAT column is treated as single precision/32bit, but debezium is considering FLOAT as a double precision floating point number and this could be the reason why we are seeing more precision added to values in the FLOAT column causing an inconsistency in the values entered in MySQL and the values received by Debezium.
Should FLOAT datatype values be treated as 32 bit/single precision numbers instead of 64bit/double precision numbers by the mysql-connector?