hunshenshi opened a new issue, #4656:
URL: https://github.com/apache/paimon/issues/4656

   ### Search before asking
   
   - [X] I searched in the [issues](https://github.com/apache/paimon/issues) 
and found nothing similar.
   
   
   ### Paimon version
   
   paimon-flink-1.18-1.0-SNAPSHOT.jar
   
   ### Compute Engine
   
   flink
   
   ### Minimal reproduce step
   
   create table in mysql 
   ``` sql
   CREATE TABLE `example_table` (
     `id` bigint NOT NULL,
     `value` float DEFAULT NULL,
     PRIMARY KEY (`id`)
   ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
   ```
   and insert data
   
   ``` sql
   INSERT INTO example_table (id, value) VALUES (1, -0.0009163);
   ```
   
   ### What doesn't meet your expectations?
   
   ``` java
   Float f = Float.valueOf(s);
   if (f.toString().length() != s.length()) {
       throw new NumberFormatException(
               s + " cannot be cast to float due to precision loss");
   } else {
       return f;
   }```
   Precision checking should not strictly rely on comparing the lengths of the 
values. As a result, values such as `-0.0009163` and similar ones, which can be 
safely represented in MySQL FLOAT, are mistakenly rejected.
   
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [X] I'm willing to submit a PR!


-- 
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]

Reply via email to