2016-12-21 20:04:27 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-02-18 03:13:52 +00:00
|
|
|
|
|
|
|
clickhouse-client --query="DROP TABLE IF EXISTS test.tskv";
|
|
|
|
clickhouse-client --query="CREATE TABLE test.tskv (tskv_format String, timestamp DateTime, timezone String, text String, binary_data String) ENGINE = Memory";
|
|
|
|
|
2017-04-06 16:34:39 +00:00
|
|
|
echo -n 'tskv tskv_format=custom-service-log timestamp=2013-01-01 00:00:00 timezone=+0400 text=multiline\ntext binary_data=can contain \0 symbol
|
|
|
|
binary_data=abc text=Hello, world
|
|
|
|
binary_data=def text=
|
2016-02-18 03:13:52 +00:00
|
|
|
tskv
|
|
|
|
|
|
|
|
' | clickhouse-client --query="INSERT INTO test.tskv FORMAT TSKV";
|
|
|
|
|
|
|
|
clickhouse-client --query="SELECT * FROM test.tskv ORDER BY binary_data";
|
|
|
|
clickhouse-client --query="DROP TABLE test.tskv";
|