druid - 使用分位数数据草图聚合器时德鲁伊的空响应
问题描述
我正在尝试计算德鲁伊指标的第 95 个百分位值。我遇到了这个文档https://druid.apache.org/docs/latest/development/extensions-core/datasketches-quantiles.html,它说我们可以在查询时从原始数据构建草图。
我准备了这个德鲁伊查询
{
"queryType": "timeseries",
"intervals": [
"2020-05-08T11:45:00.000Z/2020-05-08T11:50:00.000Z"
],
"granularity": "minute",
"dataSource": "datasource",
"filter": {
"type": "selector",
"dimension": "hostName",
"value": "host"
},
"postAggregation": [
{
"type": "quantilesDoublesSketchToQuantile",
"name": "dim",
"field": "dim",
"fraction": 0.5
}
]
}
但是当我触发这个查询时,我得到了来自德鲁伊的空洞响应。输出是
[
{
"timestamp": "2020-05-08T11:45:00.000Z",
"result": {
}
},
{
"timestamp": "2020-05-08T11:46:00.000Z",
"result": {
}
},
{
"timestamp": "2020-05-08T11:47:00.000Z",
"result": {
}
},
{
"timestamp": "2020-05-08T11:48:00.000Z",
"result": {
}
},
{
"timestamp": "2020-05-08T11:49:00.000Z",
"result": {
}
}
]
我验证了数据在该时间范围内存在于 druid 中。提前致谢
解决方案
你有一个postAggregator
type quantilesDoublesSketchToQuantile
,你正在传递 field dim
。该函数获取草图并在聚合后将其转换为分位数,但它不会构建草图,而是将草图作为输入。您首先需要使用函数创建一个聚合quantilesDoublesSketch
,这是您传入的地方dim
,然后您可以使用导致您的postAggregator
.
推荐阅读
- r - 使用 formattable 的更多样式问题
- python-3.x - Python 的命名空间包在本地开发项目中不可见
- c# - 从文本文件或作为类获取属性
- c# - 我想在 Literal createWizard 中更改 requiresUniqueEmail 错误文本
- r - 前瞻性股票日志回报
- go - go中如何从当前目录导入文件
- c# - C#人名检查和匹配算法
- mysql - sql查询中的混乱
- c++ - 如何在 GCC 中启用 C/C++“带有省略操作数的条件”(又名猫王运算符“?:”)
- javascript - 我在参数列表后收到 Uncaught SyntaxError: missing )