This file contains hidden or 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
:) SELECT number % 3 AS key, number AS x FROM system.numbers LIMIT 10 | |
SELECT | |
number % 3 AS key, | |
number AS x | |
FROM system.numbers | |
LIMIT 10 | |
┌─key─┬─x─┐ | |
│ 0 │ 0 │ |
This file contains hidden or 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 hidden or 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
================================================================= | |
==260044:302867==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61500060db01 at pc 0x00000cf8e0a5 bp 0x7f0359a478f0 sp 0x7f0359a478e8 | |
WRITE of size 8 at 0x61500060db01 thread T3436 | |
#0 0xcf8e0a4 (/usr/bin/clickhouse+0xcf8e0a4) | |
#1 0xcf8e42b (/usr/bin/clickhouse+0xcf8e42b) | |
#2 0xcf8f39f (/usr/bin/clickhouse+0xcf8f39f) | |
#3 0xcf8f78c (/usr/bin/clickhouse+0xcf8f78c) | |
#4 0xcdef1df (/usr/bin/clickhouse+0xcdef1df) | |
#5 0xcddf6af (/usr/bin/clickhouse+0xcddf6af) | |
#6 0xcde32bb (/usr/bin/clickhouse+0xcde32bb) |
This file contains hidden or 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 hidden or 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
1. Short-curcuit вычисление некоторых функций. | |
ClickHouse использует векторное вычисление выражений в запросах (vectorized query execution). То есть, каждая функция вызывается не для отдельных значений, а для небольших массивов - кусочков столбцов. Для примера, в вычисление x + y будут переданы два массива - массив значений x и массив соответствующих значений y. | |
Недостаток состоит в том, что сложнее реализовать short-curcuit операторы. К таким операторам относятся AND, OR, if. Для примера, в выражении expr1 AND expr2, будут сначала вычислены оба аргумента, а затем переданы в функцию AND. Хотя в тех строчках, где expr1 равно false, выражение expr2 вовсе не обязательно было вычислять. Это становится проблемой, когда само вычисление expr2 сложное, или когда при вычислении expr2 может быть выкинуто исключение. | |
Short-curcuit вычисление можно было бы реализовать так: | |
- вычислить expr1; | |
- отфильтровать массивы входных аргументов для вычисления expr2, оставив только значения, где expr1 = true; | |
- вычислить expr2 на |
This file contains hidden or 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
Old: | |
Running: float_parsing | |
[ | |
{ | |
"hostname": "", | |
"main_metric": "avg_rows_per_second", | |
"num_cores": 16, | |
"num_threads": 32, | |
"parameters": { |
This file contains hidden or 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
+ - сделано хотя бы в master | |
* - в процессе | |
Доработки форматов. | |
+ Protobuf | |
+ Parquet | |
+ Avro | |
+ Настраиваемое поведение CSV: separator. |
This file contains hidden or 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
ClickHouse client version 1.1.54371. | |
Connecting to localhost:9000. | |
Connected to ClickHouse server version 1.1.54371. | |
localhost :) USE test | |
USE test | |
Ok. |
This file contains hidden or 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
$ echo '[1, -1]' | clickhouse-local -S 'x Array(UInt8)' --query="SELECT * FROM table" | |
Code: 130, e.displayText() = DB::Exception: Cannot read array from text: (at row 1) | |
Row 1: | |
Column 0, name: x, type: Array(UInt8), parsed text: "[1, "ERROR | |
, e.what() = DB::Exception (from 0.0.0.0:0) (in query: SELECT * FROM table), Stack trace: | |
0. clickhouse-local(StackTrace::StackTrace()+0x12) [0x53d67b2] | |
1. clickhouse-local(DB::DataTypeArray::deserializeText(DB::IColumn&, DB::ReadBuffer&) const+0x2a4) [0x7e69cb4] |
This file contains hidden or 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
SELECT user_id, arrayReduce('sum',[if(f21<0.287376, if(f2<-1.34168, if(f21<-0.0465033, -0.0411413, -0.0168165), if(f18<0.0541038, -0.0486026, -0.0432873)), if(f2<-1.12007, if(f19<0.514323, -0.00154215, 0.0279125), if(f23<-0.0269176, -0.0391427, -0.0148464))),if(f21<0.287376, if(f2<-1.30474, if(f21<-0.0465033, -0.0407256, -0.0184058), if(f23<-0.0274336, -0.0469912, -0.0290771)), if(f2<-1.157, if(f23<-0.027484, -0.00114219, 0.029407), if(f2<-0.344426, -0.0242555, -0.0423453))),if(f18<0.883746, if(f2<-1.34168, if(f21<-0.00940569, -0.0386349, -0.00968768), if(f23<-0.0274894, -0.0458335, -0.0281316)), if(f2<-1.30474, if(f23<-0.0273632, -0.00346079, 0.0302068), if(f19<0.514323, -0.0340366, -0.00648281))),if(f21<0.250278, if(f2<-1.34168, if(f21<-0.0465033, -0.0383863, -0.0166084), if(f18<0.0541038, -0.0453193, -0.0402171)), if(f2<-1.30474, if(f22<0.233904, 0.00176162, 0.0268355), if(f2<-0.639908, -0.0178382, -0.0385038))),if(f18<0.607199, if(f2<-1.34168, if(f21<-0.00940569, -0.0373913, -0.0101554), if(f23<-0.0274336 |