Au-Miner commented on code in PR #27935:
URL: https://github.com/apache/flink/pull/27935#discussion_r3109016492
##########
flink-table/flink-table-planner/src/test/java/org/apache/flink/table/planner/plan/nodes/exec/stream/ProcessTableFunctionTestPrograms.java:
##########
@@ -1115,35 +1116,61 @@ public class ProcessTableFunctionTestPrograms {
public static final TableTestProgram PROCESS_LATE_EVENTS =
Review Comment:
Is it possible to add PROCESS_LATE_EVENTS_RESTORE.
##########
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:
Explicitly warning in Javadoc that 'unconditionally re-registering a
past-time timer from within `onTimer()` causes an infinite loop';
Is it necessary to consider adding protection, such as adding detection
logic.
Alternatively, it may be necessary to add this infinite loop error test in
the test, such as adding the timer for 'alice-again' in LateTimersFunction #
eval
--
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]