Alternative Query Languages
You can use other query languages to query data in ClickHouse using the dialect
setting. The currently supported dialects are:
clickhouse
: The default ClickHouse SQL dialectprql
: Pipelined Relational Query Language
You can execute queries using the PRQL language after setting the dialect to prql
:
SET dialect = 'prql'
Then you can use every PRQL feature that the included PRQL compiler supports:
from trips
aggregate {
ct = count this
total_days = sum days
}
Under the hood ClickHouse will translate the PRQL query into an SQL query and execute it. To switch back to the ClickHouse SQL dialect set the dialect to clickhouse
:
SET dialect = 'clickhouse'