2021-06-11 11:06:33 +00:00
|
|
|
<test>
|
2021-06-15 10:59:24 +00:00
|
|
|
<preconditions>
|
|
|
|
<table_exists>hits_100m_single</table_exists>
|
|
|
|
</preconditions>
|
|
|
|
|
2021-07-05 09:17:01 +00:00
|
|
|
<settings>
|
|
|
|
<compile_aggregate_expressions>1</compile_aggregate_expressions>
|
|
|
|
<min_count_to_compile_aggregate_expression>0</min_count_to_compile_aggregate_expression>
|
|
|
|
</settings>
|
|
|
|
|
2021-06-11 11:06:33 +00:00
|
|
|
<create_query>
|
|
|
|
CREATE TABLE jit_test_memory (
|
|
|
|
key UInt64,
|
|
|
|
value_1 UInt64,
|
|
|
|
value_2 UInt64,
|
|
|
|
value_3 UInt64,
|
|
|
|
value_4 UInt64,
|
|
|
|
value_5 UInt64,
|
|
|
|
predicate UInt8
|
|
|
|
) Engine = Memory
|
|
|
|
</create_query>
|
|
|
|
|
|
|
|
<create_query>
|
|
|
|
CREATE TABLE jit_test_merge_tree (
|
|
|
|
key UInt64,
|
|
|
|
value_1 UInt64,
|
|
|
|
value_2 UInt64,
|
|
|
|
value_3 UInt64,
|
|
|
|
value_4 UInt64,
|
|
|
|
value_5 UInt64,
|
|
|
|
predicate UInt8
|
|
|
|
) Engine = MergeTree
|
|
|
|
ORDER BY key
|
|
|
|
</create_query>
|
|
|
|
|
|
|
|
<create_query>
|
|
|
|
CREATE TABLE jit_test_merge_tree_nullable (
|
|
|
|
key UInt64,
|
|
|
|
value_1 Nullable(UInt64),
|
|
|
|
value_2 Nullable(UInt64),
|
|
|
|
value_3 Nullable(UInt64),
|
|
|
|
value_4 Nullable(UInt64),
|
|
|
|
value_5 Nullable(UInt64),
|
|
|
|
predicate UInt8
|
|
|
|
) Engine = Memory
|
|
|
|
</create_query>
|
|
|
|
|
|
|
|
<create_query>
|
|
|
|
CREATE TABLE jit_test_memory_nullable (
|
|
|
|
key UInt64,
|
|
|
|
value_1 Nullable(UInt64),
|
|
|
|
value_2 Nullable(UInt64),
|
|
|
|
value_3 Nullable(UInt64),
|
|
|
|
value_4 Nullable(UInt64),
|
|
|
|
value_5 Nullable(UInt64),
|
|
|
|
predicate UInt8
|
|
|
|
) Engine = MergeTree
|
|
|
|
ORDER BY key
|
|
|
|
</create_query>
|
|
|
|
|
|
|
|
<substitutions>
|
|
|
|
<substitution>
|
|
|
|
<name>function</name>
|
|
|
|
<values>
|
|
|
|
<value>sum</value>
|
|
|
|
<value>min</value>
|
|
|
|
<value>max</value>
|
|
|
|
<value>avg</value>
|
|
|
|
<value>any</value>
|
|
|
|
<value>anyLast</value>
|
2021-06-26 15:12:33 +00:00
|
|
|
<value>count</value>
|
2021-06-11 11:06:33 +00:00
|
|
|
</values>
|
|
|
|
</substitution>
|
|
|
|
|
|
|
|
<substitution>
|
|
|
|
<name>table</name>
|
|
|
|
<values>
|
|
|
|
<value>jit_test_memory</value>
|
|
|
|
<value>jit_test_merge_tree</value>
|
|
|
|
<value>jit_test_memory_nullable</value>
|
|
|
|
<value>jit_test_merge_tree_nullable</value>
|
|
|
|
</values>
|
|
|
|
</substitution>
|
2021-06-15 10:59:24 +00:00
|
|
|
|
|
|
|
<substitution>
|
|
|
|
<name>group_scale</name>
|
|
|
|
<values>
|
|
|
|
<value>1000000</value>
|
|
|
|
</values>
|
|
|
|
</substitution>
|
2021-06-11 11:06:33 +00:00
|
|
|
</substitutions>
|
|
|
|
|
|
|
|
<fill_query>
|
|
|
|
INSERT INTO {table}
|
|
|
|
SELECT
|
|
|
|
number % 1000000,
|
|
|
|
number,
|
|
|
|
number,
|
|
|
|
number,
|
|
|
|
number,
|
|
|
|
number,
|
|
|
|
if (number % 2 == 0, 1, 0)
|
|
|
|
FROM
|
|
|
|
system.numbers_mt
|
|
|
|
LIMIT 10000000
|
|
|
|
</fill_query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(value_1),
|
|
|
|
{function}(value_2),
|
|
|
|
{function}(value_3)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-30 11:44:45 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(value_1),
|
|
|
|
{function}(value_2),
|
|
|
|
groupBitAnd(value_3),
|
|
|
|
{function}(value_3)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-11 11:06:33 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}If(value_1, predicate),
|
|
|
|
{function}If(value_2, predicate),
|
|
|
|
{function}If(value_3, predicate)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-30 11:44:45 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}If(value_1, predicate),
|
|
|
|
{function}If(value_2, predicate),
|
|
|
|
groupBitAndIf(value_3, predicate),
|
|
|
|
{function}If(value_3, predicate)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(value_1),
|
|
|
|
{function}(value_2),
|
|
|
|
{function}(value_3),
|
|
|
|
{function}(value_4),
|
|
|
|
{function}(value_5)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-11 11:06:33 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(value_1),
|
|
|
|
{function}(value_2),
|
2021-06-30 11:44:45 +00:00
|
|
|
groupBitAnd(value_3),
|
2021-06-11 11:06:33 +00:00
|
|
|
{function}(value_3),
|
|
|
|
{function}(value_4),
|
|
|
|
{function}(value_5)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
SELECT
|
2021-06-15 10:59:24 +00:00
|
|
|
{function}If(value_1, predicate),
|
|
|
|
{function}If(value_2, predicate),
|
|
|
|
{function}If(value_3, predicate),
|
|
|
|
{function}If(value_4, predicate),
|
|
|
|
{function}If(value_5, predicate)
|
2021-06-11 11:06:33 +00:00
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-30 11:44:45 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}If(value_1, predicate),
|
|
|
|
{function}If(value_2, predicate),
|
|
|
|
groupBitAndIf(value_3, predicate),
|
|
|
|
{function}If(value_3, predicate),
|
|
|
|
{function}If(value_4, predicate),
|
|
|
|
{function}If(value_5, predicate)
|
|
|
|
FROM {table}
|
|
|
|
GROUP BY key
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
|
2021-06-15 10:59:24 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(WatchID),
|
|
|
|
{function}(CounterID),
|
|
|
|
{function}(ClientIP)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-30 11:44:45 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(WatchID),
|
|
|
|
{function}(CounterID),
|
|
|
|
groupBitAnd(ClientIP),
|
|
|
|
{function}(ClientIP)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-15 10:59:24 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(WatchID),
|
|
|
|
{function}(CounterID),
|
|
|
|
{function}(ClientIP),
|
|
|
|
{function}(GoodEvent),
|
|
|
|
{function}(CounterClass)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-30 11:44:45 +00:00
|
|
|
<query>
|
|
|
|
SELECT
|
|
|
|
{function}(WatchID),
|
|
|
|
{function}(CounterID),
|
|
|
|
groupBitAnd(ClientIP),
|
|
|
|
{function}(ClientIP),
|
|
|
|
{function}(GoodEvent),
|
|
|
|
{function}(CounterClass)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-15 10:59:24 +00:00
|
|
|
<query>
|
|
|
|
WITH (WatchID % 2 == 0) AS predicate
|
|
|
|
SELECT
|
|
|
|
{function}If(WatchID, predicate),
|
|
|
|
{function}If(CounterID, predicate),
|
|
|
|
{function}If(ClientIP, predicate)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
WITH (WatchID % 2 == 0) AS predicate
|
|
|
|
SELECT
|
|
|
|
{function}If(WatchID, predicate),
|
|
|
|
{function}If(CounterID, predicate),
|
2021-06-30 11:44:45 +00:00
|
|
|
groupBitAndIf(ClientIP, predicate),
|
|
|
|
{function}If(ClientIP, predicate)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
WITH (WatchID % 2 == 0) AS predicate
|
|
|
|
SELECT
|
|
|
|
{function}If(WatchID, predicate),
|
|
|
|
{function}If(CounterID, predicate),
|
|
|
|
{function}If(ClientIP, predicate),
|
|
|
|
{function}If(GoodEvent, predicate),
|
|
|
|
{function}If(CounterClass, predicate)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
|
|
|
<query>
|
|
|
|
WITH (WatchID % 2 == 0) AS predicate
|
|
|
|
SELECT
|
|
|
|
{function}If(WatchID, predicate),
|
|
|
|
{function}If(CounterID, predicate),
|
|
|
|
groupBitAndIf(ClientIP, predicate),
|
2021-06-15 10:59:24 +00:00
|
|
|
{function}If(ClientIP, predicate),
|
|
|
|
{function}If(GoodEvent, predicate),
|
|
|
|
{function}If(CounterClass, predicate)
|
|
|
|
FROM hits_100m_single
|
|
|
|
GROUP BY intHash32(UserID) % {group_scale}
|
|
|
|
FORMAT Null
|
|
|
|
</query>
|
|
|
|
|
2021-06-11 11:06:33 +00:00
|
|
|
<drop_query>DROP TABLE IF EXISTS {table}</drop_query>
|
2021-06-15 10:59:24 +00:00
|
|
|
</test>
|