snuyanzin commented on code in PR #25759: URL: https://github.com/apache/flink/pull/25759#discussion_r1882776646
########## flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/TimeFunctionsITCase.java: ########## @@ -732,6 +775,46 @@ 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)", + LocalDateTime.of(2020, 2, 29, 1, 56, 59, 0) + .format( + DateTimeFormatter.ofPattern( + "yyyy-MM-dd' 'HH:mm:ss.SSS")), + 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)", + LocalDateTime.of(2020, 2, 29, 1, 56, 0, 0) + .format( + DateTimeFormatter.ofPattern( + "yyyy-MM-dd' 'HH:mm:ss.SSS")), + 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)", + LocalDateTime.of(2020, 2, 29, 1, 0, 0, 0) + .format( + DateTimeFormatter.ofPattern( + "yyyy-MM-dd' 'HH:mm:ss.SSS")), Review Comment: btw this could be extracted into constant since it's used multiple times -- 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