ClickHouse/tests/queries/0_stateless/02016_summing_mt_aggregating_column.sql

21 lines
812 B
MySQL
Raw Normal View History

2021-08-31 09:13:37 +00:00
DROP TABLE IF EXISTS summing_mt_aggregating_column;
CREATE TABLE summing_mt_aggregating_column
(
Key UInt64,
Value UInt64,
2021-08-31 13:48:01 +00:00
ConcatArraySimple SimpleAggregateFunction(groupArrayArray, Array(UInt64)),
ConcatArrayComplex AggregateFunction(groupArrayArray, Array(UInt64))
2021-08-31 09:13:37 +00:00
)
ENGINE = SummingMergeTree()
ORDER BY Key;
2021-08-31 13:48:01 +00:00
INSERT INTO summing_mt_aggregating_column SELECT 1, 2, [333, 444], groupArrayArrayState([toUInt64(33), toUInt64(44)]);
INSERT INTO summing_mt_aggregating_column SELECT 1, 3, [555, 999], groupArrayArrayState([toUInt64(55), toUInt64(99)]);
2021-08-31 09:13:37 +00:00
OPTIMIZE TABLE summing_mt_aggregating_column FINAL;
2021-08-31 13:48:01 +00:00
SELECT Key, any(Value), any(ConcatArraySimple), groupArrayArrayMerge(ConcatArrayComplex) FROM summing_mt_aggregating_column GROUP BY Key;
2021-08-31 09:13:37 +00:00
DROP TABLE IF EXISTS summing_mt_aggregating_column;