Airblader commented on a change in pull request #16046:
URL: https://github.com/apache/flink/pull/16046#discussion_r648871106



##########
File path: docs/data/sql_functions.yml
##########
@@ -485,6 +485,14 @@ temporal:
     description: "Converts a epoch seconds or epoch milliseconds to a 
TIMESTAMP_LTZ, the valid precision is 0 or 3, the 0 represents 
TO_TIMESTAMP_LTZ(epochSeconds, 0), the 3 represents 
TO_TIMESTAMP_LTZ(epochMilliseconds, 3)."
   - sql: TO_TIMESTAMP(string1[, string2])
     description: "Converts date time string string1 with format string2 (by 
default: 'yyyy-MM-dd HH:mm:ss') under the session time zone (specified by 
TableConfig) to a timestamp."
+  - sql: CURRENT_WATERMARK(rowtime)
+    description: |
+      Returns the current watermark for the given rowtime attribute, or NULL 
if no watermark has been emitted yet.
+      The return type of the function is inferred to match that of the 
provided rowtime attribute, but with an adjusted precision of 3. For example, 
if the rowtime attribute is TIMESTAMP_LTZ(9), the function will return 
TIMESTAMP_LTZ(3).
+
+      Note that this function can return NULL, and you may have to consider 
this case. For example, if you want to filter out late data you can use:
+
+      WHERE CURRENT_WATERMARK(ts) IS NULL OR ts > CURRENT_WATERMARK(ts)

Review comment:
       I investigated this in Hugo a bit further. It is indeed possible, and 
I'll add a separate commit to do so. However, it must be used carefully, 
because code blocks will not word-wrap which can cause the entire table to 
scroll horizontally, which given its length makes for a really poor UX if it 
happens. I formatted this code block now to avoid being long enough to trigger 
it – but it's very easy to trigger.
   
   I think a point can be made that the table layout isn't ideal (anymore) if 
we want extensive documentation (which we do), and maybe should be thought 
about again.




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to