manner commented on code in PR #29080:
URL: https://github.com/apache/flink/pull/29080#discussion_r3926254319
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/functions/casting/CastRulesTest.java:
##########
@@ -1783,6 +1801,25 @@ Stream<CastTestSpecBuilder> testCases() {
Variant.newBuilder().of(LocalDate.of(2020, 1,
1)),
(int) LocalDate.of(2020, 1, 1).toEpochDay())
.fail(VARIANT(), Variant.newBuilder().of(1),
TableRuntimeException.class),
+ // 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(
+ VARIANT(),
+ Variant.newBuilder().of(LocalTime.of(12, 0, 0,
123_000_000)),
Review Comment:
I changed it for this occurrence only, as I think it would be harder to
understand if the different APIs get mixed in a single test case. e.g.
```java
.fromCase(
VARIANT(),
Variant.newBuilder().of(LocalTime.of(12, 0, 0, 123_456_000)),
DateTimeUtils.toInternal(LocalTime.of(12, 0,
0).plus(Duration.ofMillis(123)))
```
--
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]