gustavodemorais commented on code in PR #26091:
URL: https://github.com/apache/flink/pull/26091#discussion_r1937111535


##########
docs/data/sql_functions.yml:
##########
@@ -256,7 +256,9 @@ arithmetic:
     description: |
       Returns the exact percentile value of expr at the specified percentage 
in a group.
       
-      percentage must be a literal numeric value between `[0.0, 1.0]` or an 
array of such values. 
+      E.g., SELECT PERCENTILE(age, 0.5) FROM (VALUES (0), (50), (100)) AS age 
or $('age').percentile(0.5) returns 50.0.
+      
+      The percentage must be a literal numeric value between `[0.0, 1.0]` or 
an array of such values. 

Review Comment:
   I looked into it and makes sense. I can update the example to a non 
ambiguous one and complement the description. Suggestion:
   
   ```
   Returns the percentile value of expr at the specified percentage using 
continous distribution.
         
   E.g., SELECT PERCENTILE(age, 0.25) FROM (VALUES  (10), (20), (30), (40)) AS 
age returns 17.5
         
   The percentage must be a literal numeric value between `[0.0, 1.0]` or an 
array of such values.
   ...
   ```
   
   
   Btw, there's another paragraph right below that points to the behavior being 
of a continuous percentile function and explain to the user how the value is 
calculated when there's no exact match:
   
   ```
   If no expr lies exactly at the desired percentile, the result is calculated 
using linear interpolation of the two nearest exprs. If expr or frequency is 
NULL, or frequency is not positive, the input row will be ignored.
   ```



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