zentol commented on code in PR #25250:
URL: https://github.com/apache/flink/pull/25250#discussion_r1760877588
##########
flink-table/flink-table-runtime/src/main/java/org/apache/flink/table/data/conversion/DayTimeIntervalDurationConverter.java:
##########
@@ -40,6 +38,6 @@ public Long toInternal(java.time.Duration external) {
@Override
public java.time.Duration toExternal(Long internal) {
- return Duration.ofMillis(internal);
+ return java.time.Duration.ofMillis(internal);
Review Comment:
revert
##########
flink-python/pyflink/util/java_utils.py:
##########
@@ -38,21 +38,19 @@ def to_jarray(j_type, arr):
return j_arr
-def to_j_flink_time(time_delta):
+def to_j_duration(time_delta):
gateway = get_gateway()
- TimeUnit = gateway.jvm.java.util.concurrent.TimeUnit
- Time = gateway.jvm.org.apache.flink.api.common.time.Time
+ Duration = gateway.jvm.java.time.Duration
if isinstance(time_delta, timedelta):
- total_microseconds = round(time_delta.total_seconds() * 1000 * 1000)
- return Time.of(total_microseconds, TimeUnit.MICROSECONDS)
Review Comment:
I guess it's fine that this reduces the granularity from micro -> milli.
##########
flink-python/src/test/java/org/apache/flink/streaming/api/utils/ProtoUtilsTest.java:
##########
@@ -82,7 +80,7 @@ void testParseStateTtlConfigFromProto() {
.build();
FlinkFnApi.StateDescriptor.StateTTLConfig stateTTLConfigProto =
FlinkFnApi.StateDescriptor.StateTTLConfig.newBuilder()
- .setTtl(Time.of(1000,
TimeUnit.MILLISECONDS).toMilliseconds())
+ .setTtl(1000)
Review Comment:
urgh, why is the builder using different units and names then the
StateTTLConfig getter?
--
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]