Alternative Query Languages
Besides standard SQL, ClickHouse supports various alternative query languages for querying data.
The currently supported dialects are:
clickhouse
: The default SQL dialect of ClickHouseprql
: Pipelined Relational Query Language (PRQL)kusto
: Kusto Query Language (KQL)
Which query language is used is controlled by setting dialect
.
Standard SQL
Standard SQL is the default query language of ClickHouse.
SET dialect = 'clickhouse'
Pipelined Relational Query Language (PRQL)
Experimental feature. Learn more.
To enable PRQL:
SET allow_experimental_prql_dialect = 1;
SET dialect = 'prql'
Example PRQL query:
from trips
aggregate {
ct = count this
total_days = sum days
}
Under the hood, ClickHouse uses transpilaton from PRQL to SQL to run PRQL queries.
Kusto Query Language (KQL)
Experimental feature. Learn more.
To enable KQL:
SET allow_experimental_kusto_dialect = 1;
SET dialect = 'kusto'
Example KQL query:
numbers(10) | project number
Result:
┌─number─┐
│ 0 │
│ 1 │
│ 2 │
│ 3 │
│ 4 │
│ 5 │
│ 6 │
│ 7 │
│ 8 │
│ 9 │
└────────┘
Note that KQL queries may not be able to access all functions defined in ClickHouse.