2020-10-30 15:12:15 +00:00
|
|
|
<test>
|
2019-12-13 10:50:14 +00:00
|
|
|
|
|
|
|
<preconditions>
|
2020-05-23 14:53:54 +00:00
|
|
|
<table_exists>hits_10m_single</table_exists>
|
2019-12-13 10:50:14 +00:00
|
|
|
</preconditions>
|
|
|
|
|
2020-03-12 18:26:02 +00:00
|
|
|
<create_query>
|
|
|
|
CREATE TABLE hits2 ENGINE MergeTree
|
|
|
|
PARTITION BY toYYYYMM(EventDate)
|
|
|
|
ORDER BY (CounterID, EventDate, intHash32(UserID))
|
|
|
|
SAMPLE BY intHash32(UserID)
|
|
|
|
SETTINGS
|
|
|
|
parts_to_delay_insert = 5000,
|
|
|
|
parts_to_throw_insert = 5000
|
|
|
|
AS
|
|
|
|
-- don't select all columns to keep the run time down
|
2020-03-13 13:30:54 +00:00
|
|
|
SELECT CounterID, EventDate, UserID, Title
|
2020-03-12 18:26:02 +00:00
|
|
|
FROM hits_10m_single
|
2020-03-13 00:59:04 +00:00
|
|
|
-- do not select anything because we only need column types
|
|
|
|
LIMIT 0
|
2020-03-12 18:26:02 +00:00
|
|
|
</create_query>
|
|
|
|
<fill_query>SYSTEM STOP MERGES</fill_query>
|
2019-12-13 10:50:14 +00:00
|
|
|
|
2020-03-12 18:26:02 +00:00
|
|
|
<query>
|
|
|
|
INSERT INTO hits2
|
2020-03-13 13:30:54 +00:00
|
|
|
SELECT CounterID, EventDate, UserID, Title
|
2020-03-12 18:26:02 +00:00
|
|
|
FROM hits_10m_single
|
2020-11-20 20:23:47 +00:00
|
|
|
SETTINGS max_insert_threads=8
|
2020-03-12 18:26:02 +00:00
|
|
|
</query>
|
2019-12-13 10:50:14 +00:00
|
|
|
|
2020-03-12 18:26:02 +00:00
|
|
|
<drop_query>SYSTEM START MERGES</drop_query>
|
2019-12-13 10:50:14 +00:00
|
|
|
<drop_query>DROP TABLE IF EXISTS hits2</drop_query>
|
|
|
|
</test>
|