Add test on topKWeighted function

This commit is contained in:
Guillaume Tassery 2019-07-04 15:15:08 +02:00
parent 81e39744e2
commit 85151b339b
3 changed files with 2 additions and 1 deletions

View File

@ -304,7 +304,6 @@ public:
}
protected:
void push(Counter * counter)
{
counter->slot = counter_list.size();

View File

@ -1,2 +1,3 @@
['hello','world'] ['hello','world']
['goodbye','hello'] ['hello','world']
[99,98,97,96,95]

View File

@ -1,2 +1,3 @@
SELECT topKWeighted(2)(x, weight), topK(2)(x) FROM (SELECT t.1 AS x, t.2 AS weight FROM (SELECT arrayJoin([('hello', 1), ('world', 1), ('goodbye', 1), ('abc', 1)]) AS t));
SELECT topKWeighted(2)(x, weight), topK(2)(x) FROM (SELECT t.1 AS x, t.2 AS weight FROM (SELECT arrayJoin([('hello', 1), ('world', 1), ('goodbye', 2), ('abc', 1)]) AS t));
SELECT topKWeighted(5)(n, weight) FROM (SELECT number as n, number as weight from system.numbers LIMIT 100);