You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/06/22 09:41:58 UTC
[GitHub] [druid] laertis90 opened a new issue, #12685: Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values
laertis90 opened a new issue, #12685:
URL: https://github.com/apache/druid/issues/12685
Please provide a detailed title (e.g. "Broker crashes when using TopN query with Bound filter" instead of just "Broker crashes").
### Affected Version
0.22.1
### Description
I have a datasource that I'm trying to query using quantiles to get the median value (P50).
When there is odd number of values (eg. `10, 20, 30, 40, 50`) I get the mean value correctly: `30`.
When there is even number of values (eg. `10, 20, 30, 40`) the mean value would normally be `25`, but I'm getting `30` instead.
Sample json query:
```
{
"dataSource": "datasource_name",
"dimensions": [
{
"dimension": "__time",
"outputName": "date",
"outputType": "LONG",
"type": "default"
},
{
"dimension": "dimension1",
"outputName": "dimension1",
"outputType": "STRING",
"type": "default"
},
{
"dimension": "dimension2",
"outputName": "dimension2",
"outputType": "STRING",
"type": "default"
}
],
"granularity": {
"type": "all"
},
"filter": {
"fields": [
{
"dimension": "dimension1",
"values": [
"dimension1_filter"
],
"type": "in"
},
{
"dimension": "dimension2",
"values": [
"dimension2_filter"
],
"type": "in"
}
],
"type": "and"
},
"aggregations": [
{
"name": "quantile_quantity",
"fieldName": "quantity",
"type": "quantilesDoublesSketch",
}
],
"postAggregations": [
{
"name": "aggregated_quantity",
"field": {
"name": "aggregated_quantity",
"fieldName": "quantile_quantity",
"type": "fieldAccess"
},
"fraction": 0.5,
"type": "quantilesDoublesSketchToQuantile",
}
],
"intervals": [
"2022-06-05/2022-06-12"
],
"queryType": "groupBy"
}
```
Above query has some filters on dimensions just to limit the result to a sample of 4 values and reproduce this issue. I'm including the whole query above just in case any of these configurations affect the result I'm getting.
This is the result:
```
dimension1 aggregated_quantity dimension2 quantile_quantity date
dimension1_filter 30 dimension2_filter 4 1654387200000
```
Is there some configuration I'm missing to calculate the correct median value?
Thank you!
--
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: commits-unsubscribe@druid.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
[GitHub] [druid] RuochenLI commented on issue #12685: Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values
Posted by GitBox <gi...@apache.org>.
RuochenLI commented on issue #12685:
URL: https://github.com/apache/druid/issues/12685#issuecomment-1210534548
We face the same issue. it seems `quantilesDoublesSketchToQuantile` returns random value. Every time, it changed while running the same query
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [I] Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #12685:
URL: https://github.com/apache/druid/issues/12685#issuecomment-1922534158
This issue has been closed due to lack of activity. If you think that
is incorrect, or the issue requires additional review, you can revive the issue at
any time.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [I] Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #12685: Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values
URL: https://github.com/apache/druid/issues/12685
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [I] Incorrect result produced by quantilesDoublesSketchToQuantile with even number of values (druid)
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #12685:
URL: https://github.com/apache/druid/issues/12685#issuecomment-1876142867
This issue has been marked as stale due to 280 days of inactivity.
It will be closed in 4 weeks if no further activity occurs. If this issue is still
relevant, please simply write any comment. Even if closed, you can still revive the
issue at any time or discuss it on the dev@druid.apache.org list.
Thank you for your contributions.
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org