Return single row for aggregation without keys on empty set: development [#CLICKHOUSE-1920] #51

This commit is contained in:
Alexey Milovidov 2018-02-18 08:39:39 +03:00
parent 7415513151
commit 47ff837c9f
2 changed files with 6 additions and 0 deletions

View File

@ -2,4 +2,6 @@
0
1
0 0 nan \N [] []
0 0 nan \N [] []
0 0 nan \N [] []
1

View File

@ -7,6 +7,8 @@ SELECT count() FROM system.one WHERE rand() < 0;
SELECT count() FROM system.one WHERE 1;
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM t;
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM (SELECT * FROM t UNION ALL SELECT * FROM t);
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM remote('127.0.0.{1..10}', system.one) WHERE (rand() AS x) < 0;
SELECT x, count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM t GROUP BY x;
SET empty_result_for_aggregation_by_empty_set = 1;
@ -16,4 +18,6 @@ SELECT count() FROM system.one WHERE rand() < 0;
SELECT count() FROM system.one WHERE 1;
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM t;
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM (SELECT * FROM t UNION ALL SELECT * FROM t);
SELECT count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM remote('127.0.0.{1..10}', system.one) WHERE (rand() AS x) < 0;
SELECT x, count(), uniq(x), avg(x), avg(toNullable(x)), groupArray(x), groupUniqArray(x) FROM t GROUP BY x;