create test

This commit is contained in:
Nikita Vasilev 2019-02-14 11:49:31 +03:00
parent 28840c79ed
commit f8c0f4697c
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1 @@
"rows_read": 0,

View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
. $CURDIR/../shell_config.sh
$CLICKHOUSE_CLIENT --query="DROP TABLE IF EXISTS test.set_idx;"
$CLICKHOUSE_CLIENT -n --query="
SET allow_experimental_data_skipping_indices = 1;
CREATE TABLE test.set_idx
(
u64 UInt64,
i32 Int32,
INDEX idx (i32) TYPE set(2) GRANULARITY 1
) ENGINE = MergeTree()
ORDER BY u64
SETTINGS index_granularity = 6;"
$CLICKHOUSE_CLIENT --query="
INSERT INTO test.set_idx
SELECT number, number FROM system.numbers LIMIT 100"
# simple select
$CLICKHOUSE_CLIENT --query="SELECT * FROM test.set_idx WHERE i32 > 0 FORMAT JSON" | grep "rows_read"
$CLICKHOUSE_CLIENT --query="DROP TABLE test.set_idx;"