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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/TimeFunctionsITCase.java:
##########
@@ -732,6 +764,39 @@ private Stream<TestSetSpec> floorTestCases() {
                                 $("f2").floor(TimeIntervalUnit.MILLENNIUM),
                                 "FLOOR(f2 TO MILLENNIUM)",
                                 LocalDateTime.of(2001, 1, 1, 0, 0),
-                                TIMESTAMP().nullable()));
+                                TIMESTAMP().nullable())
+                        .testResult(
+                                $("f2").cast(TIMESTAMP_LTZ(3))
+                                        .floor(TimeIntervalUnit.SECOND)
+                                        .cast(STRING()),
+                                "CAST(FLOOR(CAST(f2 AS TIMESTAMP_LTZ(3)) TO 
SECOND) AS STRING)",
+                                formatAsTimestamp(LocalDateTime.of(2020, 2, 
29, 1, 56, 59, 0)),
+                                STRING().nullable())
+                        .testResult(
+                                $("f2").cast(TIMESTAMP_LTZ(3))
+                                        .floor(TimeIntervalUnit.MINUTE)
+                                        .cast(STRING()),
+                                "CAST(FLOOR(CAST(f2 AS TIMESTAMP_LTZ(3)) TO 
MINUTE) AS STRING)",
+                                formatAsTimestamp(LocalDateTime.of(2020, 2, 
29, 1, 56, 0, 0)),
+                                STRING().nullable())
+                        .testResult(
+                                $("f2").cast(TIMESTAMP_LTZ(3))
+                                        .floor(TimeIntervalUnit.HOUR)
+                                        .cast(STRING()),
+                                "CAST(FLOOR(CAST(f2 AS TIMESTAMP_LTZ(3)) TO 
HOUR) AS STRING)",
+                                formatAsTimestamp(LocalDateTime.of(2020, 2, 
29, 1, 0, 0, 0)),
+                                STRING().nullable())
+                        .testResult(
+                                $("f2").cast(TIMESTAMP_LTZ(3))
+                                        .floor(TimeIntervalUnit.MILLISECOND)
+                                        .cast(STRING()),
+                                "CAST(FLOOR(CAST(f2 AS TIMESTAMP_LTZ(3)) TO 
MILLISECOND) AS STRING)",
+                                formatAsTimestamp(
+                                        LocalDateTime.of(2020, 2, 29, 1, 56, 
59, 987_000_000)),
+                                STRING().nullable()));
+    }
+
+    public static String formatAsTimestamp(LocalDateTime dateTime) {

Review Comment:
   ```suggestion
       private static String formatAsTimestamp(LocalDateTime dateTime) {
   ```



-- 
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-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to