Skip to content

The Clickhouse plugin for dbt (data build tool)

License

Notifications You must be signed in to change notification settings

d1bevz/dbt-clickhouse

This branch is 614 commits behind ClickHouse/dbt-clickhouse:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

f22c3be · Apr 25, 2021

History

19 Commits
Apr 3, 2021
Apr 25, 2021
Feb 12, 2021
Feb 12, 2021
Jan 29, 2021
Apr 25, 2021
Jan 29, 2021
Apr 25, 2021
Apr 11, 2021
Jan 29, 2021
Mar 30, 2021

Repository files navigation

dbt logo

build

dbt-clickhouse

This plugin ports dbt functionality to Clickhouse.

We have not tested extensively against older versions of Clickhouse. The plugin uses syntax that requires version 20.11 or newer.

Installation

Use your favorite Python package manager to install the app from PyPI, e.g.

pip install dbt-clickhouse

Supported features

  • Table materialization
  • View materialization
  • Incremental materialization
  • Seeds
  • Sources
  • Docs generate
  • Snapshots (experimental)
  • Ephemeral materialization

Usage Notes

Database

The dbt model database.schema.table is not compatible with Clickhouse because Clickhouse does not support a schema. So we use a simple model schema.table, where schema is the Clickhouse's database. Please, don't use default database!

Model Configuration

Option Description Required?
engine The table engine (type of table) to use when creating tables Optional (default: MergeTree())
order_by A tuple of column names or arbitrary expressions. This allows you to create a small sparse index that helps find data faster. Optional (default: tuple())
partition_by A partition is a logical combination of records in a table by a specified criterion. The partition key can be any expression from the table columns. Optional
on_cluster In a cluster setup, it is possible to run such queries in a distributed manner with the ON CLUSTER clause. (Not work with Snapshots) Optional

Example Profile

your_profile_name:
  target: dev
  outputs:
    dev:
      type: clickhouse
      schema: [database name]
      host: [db.clickhouse.com]

      # optional
      port: [port]  # default 9000
      user: [user]
      password: [abc123]

About

The Clickhouse plugin for dbt (data build tool)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%