ClickHouse/tests/queries/0_stateless/03227_test_sample_n.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
601 B
MySQL
Raw Normal View History

2024-08-19 17:28:29 +00:00
CREATE TABLE IF NOT EXISTS table_name
(
id UInt64
)
ENGINE = MergeTree()
ORDER BY cityHash64(id)
SAMPLE BY cityHash64(id);
INSERT INTO table_name SELECT rand() from system.numbers limit 10000;
INSERT INTO table_name SELECT rand() from system.numbers limit 10000;
INSERT INTO table_name SELECT rand() from system.numbers limit 10000;
INSERT INTO table_name SELECT rand() from system.numbers limit 10000;
INSERT INTO table_name SELECT rand() from system.numbers limit 10000;
select count() from table_name;
SELECT count() < 50 * 5 FROM (
SELECT * FROM table_name SAMPLE 50
);
DROP TABLE table_name;