Druid Adapter
Generate Druid SQL from your model, with subqueries in place of CTEs.
What the adapter emits
- Identifiers in
"double quotes"; bare column names in expressions are lowercased. - No CTEs or temp tables. The per-fact subqueries that other dialects put in a
WITHclause are nested inline as subqueries; blends still use aFULL OUTER JOIN. - Date parts with
TIME_EXTRACT(x, 'YEAR'),TIME_EXTRACT(x, 'DOW')and so on. - The end of a
betweendate filter is extended to the last hour of the day, so a filter through2026-01-31includes that day’s rows, and date filters are not pushed down greedily into every subquery.
Configuration
druid_cluster:
adapter: druid
name: Druid Cluster
tier: hot
protocol: http
host: druid.example.com
port: 8082
Connection fields
The server never connects to Druid: it has no database driver in it, and the only keys the deployed model keeps are adapter, tier and the name. Your application runs the statement it gets back, with its own credentials.
zsql cannot read Druid: it is a dialect 0sql generates and not one of the twelve adapters zsql catalog can open, so there is no catalog read, no sampling and no zsql run against it. The fields above are for your own application. zsql deploy strips password from the file if present.
Notes
- Expressions are Druid SQL.
APPROX_COUNT_DISTINCT_DS_HLL,TIME_FLOORandLATESTare fine inexpression.sql. - A natural hot tier. Druid usually holds recent, pre-aggregated data in front of a warehouse of record. Give its tables a low
costand a date partition so the planner routes recent-data queries there. See Semantic Routing.