twalthr commented on code in PR #27929:
URL: https://github.com/apache/flink/pull/27929#discussion_r3093893552


##########
docs/content/docs/dev/table/functions/ptfs.md:
##########
@@ -932,22 +933,36 @@ table.
 
 The timestamp of the firing timer currently being processed within the 
`onTimer()` method.
 
+#### Table Watermark
+
+`TimeContext#tableWatermark()` returns the event-time watermark of the input 
table currently being processed.
+
+Watermarks are generated in sources and sent through the topology for 
advancing the logical clock. The current watermark
+of an input table is the minimum watermark of all upstream Flink subtasks 
producing the table.
+
+In multi-input scenarios, each input table can have its own independent 
watermark. This method returns the watermark
+specific to the input table that is currently being processed in the `eval()` 
method, rather than the global minimum
+watermark across all input tables (which is returned by `currentWatermark()`).
+
+This is particularly useful for late event detection on a per-input basis.
+
+It returns the current watermark of the input table being processed. `null` if 
called within the `onTimer()` method or a
+watermark has not yet been received from all upstream Flink subtasks producing 
the table.
+
 #### Current Watermark
 
-`TimeContext#currentWatermark()` returns the current event-time watermark.
+`TimeContext#currentWatermark()` returns the current event-time watermark at 
this PTF instance.
 
-Watermarks are generated in sources and sent through the topology for 
advancing the logical clock in each Flink subtask.
-The current watermark of a Flink subtask is the global minimum watermark of 
all inputs (i.e. across all parallel inputs
-and table partitions).
+Watermarks are generated in sources and sent through the topology for 
advancing the logical clock. The current watermark
+of a PTF instance is the global minimum watermark of all input tables (i.e., 
across all upstream Flink subtasks and
+table partitions).
 
 This method returns the current watermark of the Flink subtask that evaluates 
the PTF. Thus, the returned timestamp
-represents the entire Flink subtask, independent of the currently processed 
partition. This behavior is similar to a call
-to `SELECT CURRENT_WATERMARK(...)` in SQL.
+represents the entire Flink subtask, independent of the currently processed 
input table and partition. This behavior is
+similar to a call to `SELECT CURRENT_WATERMARK(...)` in SQL.
 
-If a watermark was not received from all inputs, the method returns `null`.
-
-In case this method is called within the `onTimer()` method, the returned 
watermark is the triggering watermark
-that currently fires the timer.
+It returns the current watermark at the PTF instance across all upstream Flink 
subtasks and table partitions. `null` if no
+common logical time could be determined from all input tables.

Review Comment:
   Yes, it would be the minimum. Internally Long.MIN_VALUE. Let me rephrase 
this part.



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