Skip to content

Instantly share code, notes, and snippets.

View filimonov's full-sized avatar

filimonov filimonov

View GitHub Profile
# uname -a
# Linux ip-172-31-1-128 5.4.0-1038-aws #40-Ubuntu SMP Fri Feb 5 23:53:34 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
git clone --depth=1 --branch=docker_server_from_ci_builds
cd ClickHouse/docker/server/
docker build . --network host --build-arg single_binary_location=""
docker image ls
docker tag 98f169cda25a altinity/clickhouse-server:
docker login

User-level diff between and

  • Number of PR 2167
  • Number of commits 9179
  • Number of authors 287

Tables in system database

| name | groupArray(version) |

How to add test queries to ClickHouse CI

ClickHouse has hundreds (or even thousands) of features. Every commit get checked by a complex set of tests containing many thousands of test cases.

The core functionality is very well tested, but some corner-cases and different combinations of features can be uncovered with ClickHouse CI.

Most of the bugs/regressions we see happen in that 'grey area' where test coverage is poor.

And we are very interested in covering most of the possible scenarios and feature combinations used in real life by tests.

filimonov / datatimetest.reference
Last active August 14, 2020 11:07
clickhouse timezones check
Africa/Juba (73475999,'1972-04-30 12:59:59','1972-04-30 11:59:59')
Africa/Juba (73476000,'1972-04-30 13:00:00','1972-04-30 12:00:00')
Africa/Juba (73476001,'1972-04-30 13:00:01','1972-04-30 12:00:01')
Africa/Juba (325666799,'1980-04-27 09:59:59','1980-04-27 08:59:59')
Africa/Juba (325666800,'1980-04-27 10:00:00','1980-04-27 09:00:00')
Africa/Juba (325666801,'1980-04-27 10:00:01','1980-04-27 09:00:01')
Africa/Juba (388566009,'1982-04-25 10:00:09','1982-04-25 09:00:09')
Africa/Juba (388566010,'1982-04-25 10:00:10','1982-04-25 09:00:10')
Africa/Juba (388566011,'1982-04-25 10:00:11','1982-04-25 09:00:11')
Africa/Khartoum (73475999,'1972-04-30 12:59:59','1972-04-30 11:59:59')
set -ex
set -o pipefail
trap "exit" INT TERM
trap "kill $(jobs -pr) ||:" EXIT
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
rm -rf data {affected-queries,shm-traces,trace-filtered,flamegraph-query-runs}.tsv {interesting-addrs-,stacks.}{left,right}.{tsv,rep} ||:
set -e
rm -rf {cumulative,histograms,stats,metric-names}.{tsv,png} histogram-*.png ||:
clickhouse-local --query "
-- leave only statistically significant changes of metrics of sufficient magnitude
create view metric_stats_filtered as
select *
from file('report/query-metric-stats.tsv', TSVWithNamesAndTypes,
filimonov / gist:691990c8e5ce901ca4734482c7cc81f9
Last active February 18, 2024 22:40
vscode + clickhouse-client: poorman integration
  1. File->Preferences->Settings terminal.integrated.scrollback, Increase the buffer size for terminal (i use 100000)

  2. File->Prefernces->Keyboard shortcuts workbench.action.terminal.runSelectedText set up some binding like Ctrl+Shift+'

  3. Open terminal window: Terminal->New Terminal

  4. Run clickhouse-client in a terminal.

filimonov / Dockerfile
Last active February 24, 2020 15:44
ODBC Driver roundrtip
# docker build -t yandex/clickhouse-server-with-odbc .
# docker start --name ch-odbc-roundtrip -d yandex/clickhouse-server-with-odbc
# docker exec -it ch-odbc-roundtrip clickhouse-client -mn
FROM yandex/clickhouse-server
ARG odbc_driver_url=""
RUN apt-get update \
&& apt-get install --yes --no-install-recommends unixodbc \

Kafka (Confluent 3.3.0) added support to manipulate offsets for a consumer group via cli kafka-consumer-groups command.

  1. List the topics to which the group is subscribed
kafka-consumer-groups --bootstrap-server <kafkahost:port> --group <group_id> --describe

Note the values under "CURRENT-OFFSET" and "LOG-END-OFFSET". "CURRENT-OFFSET" is the offset where this consumer group is currently at in each of the partitions.

  1. Reset the consumer offset for a topic (preview)