ClickHouse/tests/queries/0_stateless/01942_create_table_with_sample.sql

17 lines
372 B
MySQL
Raw Normal View History

2022-03-14 16:40:17 +00:00
-- Tags: no-backward-compatibility-check:21.9.1.1
2021-07-14 03:53:09 +00:00
CREATE TABLE IF NOT EXISTS sample_incorrect
2021-07-12 16:46:22 +00:00
(`x` UUID)
ENGINE = MergeTree
ORDER BY tuple(x)
SAMPLE BY x; -- { serverError 59 }
2021-07-14 03:53:09 +00:00
DROP TABLE IF EXISTS sample_correct;
CREATE TABLE IF NOT EXISTS sample_correct
2021-07-12 16:46:22 +00:00
(`x` String)
ENGINE = MergeTree
ORDER BY tuple(sipHash64(x))
SAMPLE BY sipHash64(x);
2021-07-14 03:53:09 +00:00
DROP TABLE sample_correct;