ClickHouse/tests/queries/0_stateless/02013_zlib_read_after_eof.sh

19 lines
676 B
Bash
Raw Normal View History

2021-08-25 17:42:57 +00:00
#!/usr/bin/env bash
CUR_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=../shell_config.sh
. "$CUR_DIR"/../shell_config.sh
2021-08-25 21:29:28 +00:00
DATA_FILE=$CUR_DIR/data_zlib/02013_zlib_read_after_eof_data
2021-08-25 18:01:10 +00:00
$CLICKHOUSE_CLIENT -q "DROP TABLE IF EXISTS graphite;"
2021-08-25 17:42:57 +00:00
$CLICKHOUSE_CLIENT -q "CREATE TABLE graphite(\`Path\` String, \`Value\` Float64, \`Time\` UInt32, \`Date\` Date, \`Timestamp\` UInt32) \
ENGINE = MergeTree PARTITION BY toYYYYMM(Date) ORDER BY (Path, Time) SETTINGS index_granularity = 8192;"
2021-08-25 23:19:34 +00:00
cat "$DATA_FILE" | go run $CUR_DIR/02013_zlib_read_after_eof.go
2021-08-25 17:42:57 +00:00
2021-08-25 18:01:10 +00:00
$CLICKHOUSE_CLIENT -q "SELECT count() FROM graphite;"
2021-08-25 17:42:57 +00:00
2021-08-25 18:01:10 +00:00
$CLICKHOUSE_CLIENT -q "drop table graphite;"