This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Как настроить Tableau over ClickHouse ODBC на Windows | |
==== ODBC-драйвер для Clickhouse | |
1. Надо поставить драйвер https://github.com/yandex/clickhouse-odbc/releases/latest | |
2. Создать источник данных odbc. Пример: | |
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-dsn-windows-5-2.html | |
Надо выбрать Unicode версию odbc-драйвера |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --network host --name mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:5.7 | |
$ mysql -uroot --password=my-secret-pw --host=127.0.0.1 | |
CREATE DATABASE test_dictionary; | |
CREATE TABLE test_dictionary.RefProfit | |
( | |
sourceId int(11) NOT NULL, | |
money decimal(5,5) unsigned NOT NULL, | |
dateStart date NOT NULL DEFAULT '1970-01-01', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Кодирование строк со словарём и обработка запроса без декодирования строк | |
===Мотивация | |
Пользователи часто используют тип данных %%String%% для хранения повторяющихся строковых значений. Мы всегда говорим, что это - антипаттерн и рекомендуем либо вручную писать вместо строк числовые идентификаторы, либо использовать %%Enum%%, либо использовать внешние словари. Но есть причины, по которым такой сценарий использования будет продолжать использоваться, и нам необходимо к нему адаптироваться. | |
Пример на данных Метрики Приложений: | |
(вырезано цензурой) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Оптимизация стратегии слияний. | |
Включить part_log. Для этого, раскомментируйте part_log в конфигурационном файле сервера. | |
Посмотреть на то, что происходит при вставке синтетических данных. | |
В clickhouse-client: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"hostname": "mtlog-perftest03j.yandex.ru", | |
"main_metric": "min_time", | |
"num_cores": 16, | |
"num_threads": 32, | |
"parameters": { | |
"func": ["sum", "uniq", "uniqExact", "uniqHLL12", "uniqCombined(12)", "uniqCombined(13)", "uniqCombined(14)", "uniqCombined(15)", "uniqCombined(16)", "uniqCombined(17)", "uniqCombined(18)", "uniqCombined(19)", "uniqCombined(20)", "uniqUpTo(3)", "uniqUpTo(5)", "uniqUpTo(10)", "uniqUpTo(25)", "uniqUpTo(100)"], | |
"key": ["1", "SearchEngineID", "RegionID", "SearchPhrase", "ClientIP"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Поддержка Protobuf как формата ввода-вывода для ClickHouse. | |
ClickHouse поддерживает всевозможные форматы данных для получения результата запроса SELECT или для загрузки данных при INSERT. К этим форматам относятся как текстовые (CSV, TSV, JSONEachRow) так и бинарные (RowBinary, Native). | |
Пользователи хотят иметь в качестве доступного формата ещё и Protobuf. | |
Формат представляет собой записанные подряд Protobuf сообщения, по одному на каждую строку таблицы, разделённые неким общепринятым способом: https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/util/delimited_message_util.h | |
Пользователь может предоставить свою protobuf схему для загрузки и выгрузки данных. Это определяется настройкой format_schema (по аналогии с имеющимся форматом CapNProto). При этом, схема может более-менее свободно относиться к таблице. Так, один тип данных ClickHouse может быть по-разному представлен в protobuf схеме. Например, UInt8 в ClickHouse может быть int64 в Protobuf. String может быть представлен и как |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget https://clickhouse-datasets.s3.yandex.net/hits/tsv/hits_v1.tsv.xz | |
wget https://clickhouse-datasets.s3.yandex.net/visits/tsv/visits_v1.tsv.xz | |
xz -v -d hits_v1.tsv.xz | |
xz -v -d visits_v1.tsv.xz | |
clickhouse-client | |
CREATE TABLE test.hits ( WatchID UInt64, JavaEnable UInt8, Title String, GoodEvent Int16, EventTime DateTime, EventDate Date, CounterID UInt32, ClientIP UInt32, ClientIP6 FixedString(16), RegionID UInt32, UserID UInt64, CounterClass Int8, OS UInt8, UserAgent UInt8, URL String, Referer String, URLDomain String, RefererDomain String, Refresh UInt8, IsRobot UInt8, RefererCategories Array(UInt16), URLCategories Array(UInt16), URLRegions Array(UInt32), RefererRegions Array(UInt32), ResolutionWidth UInt16, ResolutionHeight UInt16, ResolutionDepth UInt8, FlashMajor UInt8, FlashMinor UInt8, FlashMinor2 String, NetMajor UInt8, NetMinor UInt8, UserAgentMajor UInt16, UserAgentMinor FixedString(2), CookieEnable UInt8, JavascriptEnable UInt8, IsMobile UInt8, MobilePhone UI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Дополнительные индексные структуры для пропуска блоков данных в таблицах. | |
Secondary index structures for data skipping in ClickHouse DBMS. | |
Васильев Никита Сергеевич, Курс 2, БПМИ171 | |
Методы индексации данных на основе space filling curves. | |
Data indexing methods with space filling curves in ClickHouse DBMS. | |
Чулков Андрей Сергеевич, Курс 2, БПМИ171 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:) CREATE TABLE test.sessions (begin DateTime, end DateTime) ENGINE = Memory | |
CREATE TABLE test.sessions | |
( | |
begin DateTime, | |
end DateTime | |
) ENGINE = Memory | |
Ok. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ docker run --rm -it centos:7 /bin/bash | |
Unable to find image 'centos:7' locally | |
7: Pulling from library/centos | |
d8d02d457314: Pull complete | |
Digest: sha256:307835c385f656ec2e2fec602cf093224173c51119bbebd602c53c3653a3d6eb | |
Status: Downloaded newer image for centos:7 | |
[root@295dd8ae621f /]# yum install yum-utils | |
Loaded plugins: fastestmirror, ovl | |
Determining fastest mirrors | |
* base: mirror.docker.ru |