Fixed error in aggregate function "anyHeavy"; added a test [#CLICKHOUSE-3867]

This commit is contained in:
Alexey Milovidov 2018-07-27 22:51:13 +03:00
parent 448bcdfdb4
commit a2101df25a
3 changed files with 3 additions and 1 deletions

View File

@ -646,7 +646,7 @@ struct AggregateFunctionAnyHeavyData : Data
}
else
{
if (counter < to.counter)
if ((!this->has() && to.has()) || counter < to.counter)
{
this->change(to, arena);
return true;

View File

@ -0,0 +1 @@
4 ['hello','world'] hello

View File

@ -0,0 +1 @@
WITH arrayJoin(['hello', 'world']) AS s SELECT count(), arraySort(groupUniqArray(s)), anyHeavy(s) FROM remote('127.0.0.{2,3}', system.one);