raminqaf commented on code in PR #26862:
URL: https://github.com/apache/flink/pull/26862#discussion_r2254728945


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/CastFunctionITCase.java:
##########
@@ -649,9 +649,9 @@ private static List<TestSetSpec> allTypesBasic() {
                                 BIGINT(), DEFAULT_POSITIVE_BIGINT, (double) 
DEFAULT_POSITIVE_BIGINT)
                         .fromCase(
                                 BIGINT(), DEFAULT_NEGATIVE_BIGINT, (double) 
DEFAULT_NEGATIVE_BIGINT)
-                        .fromCase(FLOAT(), DEFAULT_POSITIVE_FLOAT, 123.456d)
-                        .fromCase(FLOAT(), DEFAULT_NEGATIVE_FLOAT, -123.456)
-                        .fromCase(FLOAT(), 9234567891.12, 9234567891.12d)
+                        .fromCase(FLOAT(), DEFAULT_POSITIVE_FLOAT, 
123.45600128173828)
+                        .fromCase(FLOAT(), DEFAULT_NEGATIVE_FLOAT, 
-123.45600128173828)
+                        .fromCase(FLOAT(), 9234567891.12, 9.234568192E9)
                         .fromCase(DOUBLE(), DEFAULT_POSITIVE_DOUBLE, 
DEFAULT_POSITIVE_DOUBLE)

Review Comment:
   After disabling the constant folding, these tests broke. For now, I have 
briefly checked the generated code (I will have a deeper look tomorrow). I 
noticed that the conversion in Java would yield these results:
   ```java
   String s = "-3276913443134";
   double sd = Double.valueOf(s); 
   System.out.println(sd); // Prints: -3.276913443134E12
   
   float f = 123.456f;
   double d = (double) f;
   System.out.println(d); // Prints: 123.45600128173828
   
   float nf = -123.456f;
   double nd = (double) nf;
   System.out.println(nd); // Prints: -123.45600128173828
   
   float lf = 9234567891.12f;
   double ld = (double) lf;
   System.out.println(ld); // Prints: 9.234568192E9
   ```
   
   This aligns with the changed 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to