snuyanzin commented on code in PR #29690:
URL: https://github.com/apache/flink/pull/29690#discussion_r4452461381
##########
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:
what is is the minimum supported date in VARIANT?
Should we have tests for before Julian?
Also how about years like 1600 and similar?
--
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]