feat: with clickhouse
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
f8ef7701ea
commit
a0be74c4d8
12
templates/create_clickhouse_sink.sql
Normal file
12
templates/create_clickhouse_sink.sql
Normal file
@ -0,0 +1,12 @@
|
||||
CREATE SINK click_stats
|
||||
FROM
|
||||
m_click_statistic WITH (
|
||||
connector = 'clickhouse',
|
||||
type = 'append-only',
|
||||
force_append_only='true',
|
||||
clickhouse.url = 'http://clickhouse-server-1:8123',
|
||||
clickhouse.user = 'default',
|
||||
clickhouse.password = '',
|
||||
clickhouse.database = 'default',
|
||||
clickhouse.table='click_stats',
|
||||
);
|
43
templates/docker-compose.clickhouse.yaml
Normal file
43
templates/docker-compose.clickhouse.yaml
Normal file
@ -0,0 +1,43 @@
|
||||
services:
|
||||
clickhouse-server:
|
||||
image: clickhouse/clickhouse-server:24-alpine
|
||||
container_name: clickhouse-server-1
|
||||
hostname: clickhouse-server-1
|
||||
ports:
|
||||
- "8123:8123"
|
||||
- "9000:9000"
|
||||
- "9004:9004"
|
||||
expose:
|
||||
- 8123
|
||||
- 9009
|
||||
configs:
|
||||
- source: clickhouse_init
|
||||
target: /docker-entrypoint-initdb.d/init-db.sh
|
||||
|
||||
clickhouse-ui:
|
||||
image: "ghcr.io/caioricciuti/ch-ui:latest"
|
||||
ports:
|
||||
- 5521:5521
|
||||
environment:
|
||||
- VITE_CLICKHOUSE_URL=http://localhost:8123
|
||||
- VITE_CLICKHOUSE_USER=default
|
||||
#- VITE_CLICKHOUSE_PASS=default
|
||||
depends_on:
|
||||
- clickhouse-server
|
||||
|
||||
configs:
|
||||
clickhouse_init:
|
||||
content: |
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
clickhouse client -n <<-EOSQL
|
||||
CREATE table click_stats(
|
||||
clicks_count Int64,
|
||||
ad_id Int64
|
||||
)ENGINE = ReplacingMergeTree
|
||||
PRIMARY KEY (ad_id);
|
||||
|
||||
EOSQL
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user