2016-12-21 20:04:27 +00:00
|
|
|
#!/usr/bin/env bash
|
2016-02-18 03:13:52 +00:00
|
|
|
|
2017-12-15 19:34:19 +00:00
|
|
|
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
2020-08-01 00:51:12 +00:00
|
|
|
. "$CURDIR"/../shell_config.sh
|
2017-12-15 19:34:19 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS tskv";
|
2020-07-13 02:26:22 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query="CREATE TABLE tskv (tskv_format String, timestamp DateTime('UTC'), timezone String, text String, binary_data String) ENGINE = Memory";
|
2016-02-18 03:13:52 +00:00
|
|
|
|
2020-08-01 01:14:25 +00:00
|
|
|
# shellcheck disable=SC2028
|
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
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
' | $CLICKHOUSE_CLIENT --query="INSERT INTO tskv FORMAT TSKV";
|
2016-02-18 03:13:52 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
$CLICKHOUSE_CLIENT --query="SELECT * FROM tskv ORDER BY binary_data";
|
|
|
|
$CLICKHOUSE_CLIENT --query="DROP TABLE tskv";
|