example

command
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 16, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

README

Example of usage

Setup

  1. Run ClickHouse
docker run -d --name ch-rollup-clickhouse -p 8123:8123 -p 9000:9000 -e CLICKHOUSE_PASSWORD=ch-rollup clickhouse/clickhouse-server:24.6
  1. Create table

Connect to ClickHouse:

docker exec -it ch-rollup-clickhouse clickhouse-client

Then create table:

CREATE TABLE test_table_agg(
  col1 UInt64,
  counter AggregateFunction(count, UInt64),
  rollup_interval UInt64, 
  event_time DateTime
)
  ENGINE=AggregatingMergeTree ORDER BY (col1, counter, event_time) PARTITION BY toYYYYMMDD(event_time);
  1. Copy main.go content

Just copy main.go content to your code.

  1. Run it
go run main.go

Documentation

Overview

Package main contains example of ch-rollup usage.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL