Skip to main content

How to Use Parameterized Views in ClickHouse

Learn how to create and query parameterized views in ClickHouse for dynamic data slicing based on query-time parameters.

Using Parameterized Views in ClickHouse

Parameterized views can be handy to slice and dice data on the fly based on some parameters that can be fed at query execution time.

See this basic example:

  1. create a table
  1. insert some sample random data
  1. create the parameterized view:
  1. query the parameterized view by feeding the expected parameters in your FROM clause:

For more info, please refer to https://clickhouse.com/docs/en/sql-reference/statements/create/view#parameterized-view

· 2 min read