Skip to main content

Overview

Write data to ClickHouse for high-performance analytical queries.

Configuration

sinks:
  my_clickhouse_sink:
    type: clickhouse
    from: my_transform
    table: my_table
    secret_name: MY_CLICKHOUSE_SECRET
    primary_key: id

Parameters

type
string
required
Must be clickhouse
from
string
required
The transform or source to read data from
table
string
required
ClickHouse table name
primary_key
string
required
Primary key column for the table
secret_name
string
required
Name of the secret containing ClickHouse connection details

Secret Format

The secret should contain ClickHouse connection details:
https://username:password@host:port/database

Example: Solana Blocks to ClickHouse

name: solana-blocks-analytics
resource_size: m

sources:
  solana_blocks:
    type: solana_source
    start_block: "312229952"
    num_workers: "50"

transforms:
  parsed_blocks:
    type: sql
    primary_key: slot
    sql: |
      SELECT
        slot,
        to_timestamp_micros(blockTime * 1000000) as block_timestamp,
        array_length(transactions) as transaction_count,
        blockhash,
        _gs_op
      FROM solana_blocks

sinks:
  clickhouse_blocks:
    type: clickhouse
    from: parsed_blocks
    table: solana_blocks
    primary_key: slot
    secret_name: MY_CLICKHOUSE
ClickHouse is ideal for high-volume data and analytical queries. Use it when you need to run aggregations and analytics on your blockchain data.