【发布时间】:2017-07-18 21:44:00
【问题描述】:
在我的 Druid 数据源中,我在其中一个字段上有一个 hyperUnique 聚合(摄取时间)。
我正在尝试在此聚合字段上执行与 COUNT(DISTINCT(<hyperunique_field>)) 等效的操作。
方解石德鲁伊适配器是否支持它?如果是这样,正确的做法是什么?
在胶合板中,我可以做到COUNT_DISTINCT。运行此返回 0 个计数。
SQL:
select floor("__time" to HOUR) time_bucket,"field_1", count(distinct("ingestion_time_aggregated_field")) as uniq from "datasource" where "__time" between '2017-01-01 00:00:00'和 '2017-01-02 00:00:00' 和 “field_1” 在 ('value_1') 和 “field_2”='value_2' 和 “field_3”='value_3' 和 “field_4”='value_4' 按楼层分组("__time" to HOUR),"field_1" order by floor("__time" to HOUR);
摄取时间_聚合字段:
{"name": "ingestion_time_aggregated_field", "type": "hyperUnique","fieldName": “field” }
【问题讨论】:
标签: druid apache-calcite