Skip to content

Instantly share code, notes, and snippets.

View a1mzone's full-sized avatar

Zakk a1mzone

  • S.A.
View GitHub Profile
@a1mzone
a1mzone / druid.md
Last active April 14, 2025 14:05
Druid

Apache Druid

Query

SELECT 
    COUNT(*) AS total, 
    DATE_TRUNC('day', TIME_PARSE("created_at",'yyyy-MM-dd HH:mm:ss.S')) AS dom 
FROM source 
WHERE DATE_TRUNC('day', TIME_PARSE("created_at",'yyyy-MM-dd HH:mm:ss.S')) >= '2024-08-01' 

AND DATE_TRUNC('day', TIME_PARSE("created_at",'yyyy-MM-dd HH:mm:ss.S')) < CURRENT_DATE