snuyanzin commented on code in PR #27132:
URL: https://github.com/apache/flink/pull/27132#discussion_r2444368942


##########
flink-table/flink-table-common/src/main/java/org/apache/flink/table/catalog/IntervalFreshness.java:
##########
@@ -31,42 +34,102 @@
 @PublicEvolving
 public class IntervalFreshness {
 
-    private final String interval;
+    private final int interval;
     private final TimeUnit timeUnit;
 
-    private IntervalFreshness(String interval, TimeUnit timeUnit) {
+    private IntervalFreshness(int interval, TimeUnit timeUnit) {
         this.interval = interval;
         this.timeUnit = timeUnit;
     }
 
     public static IntervalFreshness of(String interval, TimeUnit timeUnit) {
-        return new IntervalFreshness(interval, timeUnit);
+        final int validateIntervalInput = validateIntervalInput(interval);
+        return new IntervalFreshness(validateIntervalInput, timeUnit);
+    }
+
+    private static int validateIntervalInput(final String interval) {
+        final String errorMessage =
+                String.format(
+                        "The freshness interval currently only supports 
positive integer type values. But was: %s",
+                        interval);

Review Comment:
   I guess we can init this only in case of failure rather than always



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