fhueske commented on code in PR #27935:
URL: https://github.com/apache/flink/pull/27935#discussion_r3109096730


##########
docs/content.zh/docs/dev/table/functions/ptfs.md:
##########
@@ -1021,6 +1021,18 @@ class TimerFunction extends ProcessTableFunction<String> 
{
 {{< /tab >}}
 {{< /tabs >}}
 
+### Handling of Late Records
+
+A late record is a record with a time attribute value that is less than or 
equal to the current
+watermark. PTFs handle late records just like non-late records by calling the 
`eval()` method. If
+the `on_time` argument is specified, the late timestamp is preserved in the 
output. This behavior is
+the same for PTFs with row and set semantics.
+
+Registering a timer for a time that is less than or equal to the current 
watermark is allowed.
+If registered from within `eval()`, the timer fires on the next watermark 
advance. If registered
+from within `onTimer()`, the timer fires immediately after the current timer 
finishes. Note that
+unconditionally re-registering a past-time timer from within `onTimer()` 
causes an infinite loop.

Review Comment:
   This is the same behavior as for other functions with access to timers such 
as KeyedProcessFunction.
   Before this change, we ignored the registrations of timers with a timestamp 
< current_watermark, which is inconsistent with Flink's other functions and 
surprising for Flink users.
   
   We might be able to introduce guards against such behavior, but I don't 
think it is necessary. I don't think this is a common problem and adding logic 
to detect and prevent such logic would cause more problems than it solves.



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