diff --git a/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.reference b/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.reference index 42cb3bf7829..41ad31c77a0 100644 --- a/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.reference +++ b/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.reference @@ -2,4 +2,6 @@ 0 1 0 0 nan \N [] [] +0 0 nan \N [] [] +0 0 nan \N [] [] 1 diff --git a/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.sql b/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.sql index 2d627ede8b2..863b88cd033 100644 --- a/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.sql +++ b/dbms/tests/queries/0_stateless/00572_aggregation_by_empty_set.sql @@ -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;