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


##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/casting/CastRulesTest.java:
##########
@@ -2316,7 +2316,24 @@ Stream<CastTestSpecBuilder> testCases() {
                                 VARIANT(),
                                 VARIANT_BUILDER.of(LocalDate.of(2020, 1, 1)),
                                 (int) LocalDate.of(2020, 1, 1).toEpochDay())
-                        .fail(VARIANT(), Variant.newBuilder().of(1), 
TableRuntimeException.class),
+                        // a timestamp keeps its date, in the session time 
zone for a TIMESTAMP_LTZ
+                        .fromCase(
+                                VARIANT(),
+                                CET_CONTEXT,
+                                
VARIANT_BUILDER.of(Instant.parse("2020-01-01T23:30:00Z")),
+                                (int) LocalDate.of(2020, 1, 2).toEpochDay())
+                        // before 1970, the day is still the one the timestamp 
falls on
+                        .fromCase(
+                                VARIANT(),
+                                VARIANT_BUILDER.of(LocalDateTime.of(1969, 12, 
31, 23, 0)),

Review Comment:
   Added the tests for these edge cases



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