2020-11-03 13:12:27 +00:00
|
|
|
<test>
|
2020-11-05 09:20:05 +00:00
|
|
|
<preconditions>
|
|
|
|
<table_exists>hits_100m_single</table_exists>
|
|
|
|
</preconditions>
|
|
|
|
|
2020-11-03 13:12:27 +00:00
|
|
|
<create_query>DROP TABLE IF EXISTS perf_avg</create_query>
|
|
|
|
<create_query>SET allow_experimental_bigint_types=1</create_query>
|
|
|
|
|
|
|
|
<create_query>CREATE TABLE perf_avg(
|
|
|
|
num UInt64,
|
2020-11-04 13:14:07 +00:00
|
|
|
num_u Decimal256(75) DEFAULT toDecimal256(num / 400000, 75),
|
2020-11-05 09:20:05 +00:00
|
|
|
num_f Float64 DEFAULT num / 100
|
2020-11-03 13:12:27 +00:00
|
|
|
) ENGINE = MergeTree() ORDER BY tuple()
|
|
|
|
</create_query>
|
|
|
|
|
|
|
|
<fill_query>
|
|
|
|
INSERT INTO perf_avg(num)
|
2020-11-05 09:20:05 +00:00
|
|
|
SELECT toUInt64(UserID / (WatchID + 1) * 1000000)
|
|
|
|
FROM hits_100m_single
|
2020-11-03 13:12:27 +00:00
|
|
|
</fill_query>
|
|
|
|
|
|
|
|
<query>SELECT avg(num) FROM perf_avg</query>
|
2020-11-04 13:14:07 +00:00
|
|
|
<query>SELECT avg(2 * num) FROM perf_avg</query>
|
2020-11-03 13:12:27 +00:00
|
|
|
<query>SELECT avg(num_u) FROM perf_avg</query>
|
|
|
|
<query>SELECT avg(num_f) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_f, num) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_f, num_f) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_f, num_u) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_u, num_f) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_u, num) FROM perf_avg</query>
|
|
|
|
<query>SELECT avgWeighted(num_u, num_u) FROM perf_avg</query>
|
|
|
|
|
|
|
|
<drop_query>DROP TABLE IF EXISTS perf_avg</drop_query>
|
|
|
|
</test>
|