fix usage of 'distinct' combinator with 'state' combinator

This commit is contained in:
Anton Popov 2021-02-18 02:19:58 +03:00
parent 3429925338
commit dcba99f4b1
3 changed files with 18 additions and 0 deletions

View File

@ -236,6 +236,11 @@ public:
return true;
}
bool isState() const override
{
return nested_func->isState();
}
AggregateFunctionPtr getNestedFunction() const override { return nested_func; }
};

View File

@ -2,3 +2,7 @@
[0,1,2,3,4,5,6,7,8,9,10,11,12]
20
0.49237
78
[0,1,2,3,4,5,6,7,8,9,10,11,12]
20
0.49237

View File

@ -1,3 +1,12 @@
SET distributed_aggregation_memory_efficient = 1;
SELECT sum(DISTINCT number % 13) FROM remote('127.0.0.{1,2}', numbers_mt(100000));
SELECT arraySort(groupArray(DISTINCT number % 13)) FROM remote('127.0.0.{1,2}', numbers_mt(100000));
SELECT finalizeAggregation(countState(DISTINCT toString(number % 20))) FROM remote('127.0.0.{1,2}', numbers_mt(100000));
SELECT round(corrStable(DISTINCT x, y), 5) FROM (SELECT number % 10 AS x, number % 5 AS y FROM remote('127.0.0.{1,2}', numbers(1000)));
SET distributed_aggregation_memory_efficient = 0;
SELECT sum(DISTINCT number % 13) FROM remote('127.0.0.{1,2}', numbers_mt(100000));
SELECT arraySort(groupArray(DISTINCT number % 13)) FROM remote('127.0.0.{1,2}', numbers_mt(100000));
SELECT finalizeAggregation(countState(DISTINCT toString(number % 20))) FROM remote('127.0.0.{1,2}', numbers_mt(100000));