Implement percentile_disc function
- Dominant language
- Java
- Stars
- 4.4k
- Forks
- 616
- Avg merge
- 14h 49m
- Merged PRs (30d)
- 206
Description
### Problem Statement
This function is part of the Postgres dialect, see it here https://www.postgresql.org/docs/9.4/functions-aggregate.html, and is not currently supported by CrateDB.
This compatibility issue was identified when using the jupySQL with the following command:
`%sqlplot boxplot --table history_tsx --column value`
The command generated the following query, which output an error, saying the `percentile_disc` function is not available.
```
SELECT
percentile_disc([0.25, 0.50, 0.75]) WITHIN GROUP (ORDER BY "value") AS percentiles,
AVG("value") AS mean,
COUNT(*) AS N
FROM "history_tsx"
```
### Possible Solutions
```
SELECT
percentile_disc([0.25, 0.50, 0.75]) WITHIN GROUP (ORDER BY "value") AS percentiles
FROM table_ex
```
### Considered Alternatives
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.