snuyanzin commented on code in PR #30214:
URL: https://github.com/apache/flink/pull/30214#discussion_r4754544752


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/casting/CastRulesTest.java:
##########
@@ -689,6 +724,46 @@ Stream<CastTestSpecBuilder> testCases() {
                                 STRING(),
                                 fromString("23:45"),
                                 DateTimeUtils.toInternal(LocalTime.of(23, 45, 
0)))
+                        .fromCase(
+                                STRING(),
+                                fromString(" 12 : 30 : 45 "),
+                                DateTimeUtils.toInternal(LocalTime.of(12, 30, 
45)))
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45+02"),
+                                DateTimeUtils.toInternal(LocalTime.of(14, 30, 
45)))
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45+02:00"),
+                                DateTimeUtils.toInternal(LocalTime.of(14, 30, 
45)))
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45-02:30"),
+                                DateTimeUtils.toInternal(LocalTime.of(10, 0, 
45)))

Review Comment:
   removed



##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/casting/CastRulesTest.java:
##########
@@ -2338,6 +2413,19 @@ Stream<CastTestSpecBuilder> testCases() {
                 // A variant keeps microseconds for TIME, so fractional 
seconds beyond the target
                 // precision are truncated, matching a regular cast into a 
narrower TIME.
                 CastTestSpecBuilder.testCastTo(TIME(3))
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45.123"),
+                                DateTimeUtils.toInternal(LocalTime.of(12, 30, 
45, 123_000_000)))
+                        // the digit after the milliseconds rounds them
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45.1235"),
+                                DateTimeUtils.toInternal(LocalTime.of(12, 30, 
45, 124_000_000)))
+                        .fromCase(
+                                STRING(),
+                                fromString("12:30:45. 123 "),
+                                DateTimeUtils.toInternal(LocalTime.of(12, 30, 
45, 123_000_000)))

Review Comment:
   moved



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