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


##########
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:
   Sorry, during the first iteration I didn't test the examples...
   
   Now it took me almost half an hour to realize that this is based on a 
continuous distribution...
   I think we need to think about other example here...
   It returns same result for the case of 0.5 for both
   however in case of discrete distribution
   ```sql
   SELECT PERCENTILE(age, 0.25) FROM (VALUES (0), (25), (50), (100)) AS age
   ```
   I would expect output 25.0 however it shows different result (since the 
function is for continuous)
   
   It should be explicitly mentioned in the doc since in SQL Standard there are 
`PERCENTILE_CONT` and `PERCENTILE_DISC`.
   
   
   



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