2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE IF EXISTS agg_over_nullable;
|
2022-06-23 08:37:52 +00:00
|
|
|
set allow_deprecated_syntax_for_merge_tree=1;
|
2019-04-16 14:13:13 +00:00
|
|
|
CREATE TABLE agg_over_nullable (
|
2017-12-14 09:02:12 +00:00
|
|
|
partition Date,
|
|
|
|
timestamp DateTime,
|
|
|
|
user_id Nullable(UInt32),
|
|
|
|
description Nullable(String)
|
|
|
|
) ENGINE = MergeTree(partition, timestamp, 8192);
|
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
INSERT INTO agg_over_nullable(partition, timestamp, user_id, description) VALUES(now(), now(), 1, 'ss');
|
|
|
|
INSERT INTO agg_over_nullable(partition, timestamp, user_id, description) VALUES(now(), now(), 1, NULL);
|
|
|
|
INSERT INTO agg_over_nullable(partition, timestamp, user_id, description) VALUES(now(), now(), 1, 'aa');
|
2017-12-14 09:02:12 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
SELECT arraySort(groupUniqArray(description)) FROM agg_over_nullable;
|
|
|
|
SELECT arraySort(topK(3)(description)) FROM agg_over_nullable;
|
2017-12-14 09:02:12 +00:00
|
|
|
|
2019-04-16 14:13:13 +00:00
|
|
|
DROP TABLE agg_over_nullable;
|