NikitaElmanov opened a new issue, #12699:
URL: https://github.com/apache/druid/issues/12699
Hello!
I’d like to count 99 percentile by using sql druid query. There’s no enough
info about function in documentation.
Now I have the next query:
```
SELECT
__time as "time",
AVG(sla) as " ", --!!!!!!!!!!!!!!!!!!!!!!!!!!
name as "service"
FROM SYTESTER_DRUID
WHERE ('${service}' = 'Show All' OR name in (${service:sqlstring}))
AND __time >= MILLIS_TO_TIMESTAMP(${__from}) AND __time <=
MILLIS_TO_TIMESTAMP(${__to})
GROUP BY __time, name
```
But I need to apply 99 percentile instead of arithmetic mean. In my opinion,
query must looks like:
```
SELECT
__time as "time",
DS_GET_QUANTILE(sla, 0.99) as " ", --!!!!!!!!!!!!!!!!!!!!!!!!!!
name as "service"
FROM SYTESTER_DRUID
WHERE ('${service}' = 'Show All' OR name in (${service:sqlstring}))
AND __time >= MILLIS_TO_TIMESTAMP(${__from}) AND __time <=
MILLIS_TO_TIMESTAMP(${__to})
GROUP BY __time, name
```
What function from:
_TDIGEST_QUANTILE
DS_GET_QUANTILE
APPROX_QUANTILE
DS_QUANTILE_SUMMARY_
should I use?
And can you share with me with druid sql examples with …QUANTILE… functions?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]