Druid 的几个查询实例

下面是你可以在 Druid 上尝试进行查询的一些实例供你测试:

对时间进行查询

SELECT FLOOR(__time to HOUR) AS HourTime, SUM(deleted) AS LinesDeleted
FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00'
GROUP BY 1

 

Druid 的几个查询实例

 

基本的 group by

SELECT channel, page, SUM(added)
FROM wikipedia WHERE "__time" BETWEEN TIMESTAMP '2015-09-12 00:00:00' AND TIMESTAMP '2015-09-13 00:00:00'
GROUP BY channel, page
ORDER BY SUM(added) DESC

 

Druid 的几个查询实例

 

Druid 能够进行一些比较灵活的查询,因此对基本的 SQL 掌握还是需要的。

 

https://www.ossez.com/t/druid/13633

上一篇:Druid 加载 Kafka 数据时通过控制台来提交一个 supervisor


下一篇:Druid 从控制台(Druid console)中查询字段