mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
CLICKHOUSE-4644 arrayEnumerateUniqRanked: fix for empty arrays
This commit is contained in:
parent
14e16c7a41
commit
184e2ef9ab
@ -336,7 +336,9 @@ void FunctionArrayEnumerateRankedExtended<Derived>::executeMethodImpl(
|
||||
/// Skipping offsets if no data in this array
|
||||
if (prev_off == off)
|
||||
{
|
||||
want_clear = true;
|
||||
|
||||
if (depth_to_look > 2)
|
||||
want_clear = true;
|
||||
|
||||
if (depth_to_look >= 2)
|
||||
{
|
||||
|
@ -278,3 +278,9 @@ a1,a2 12 [1,2]
|
||||
1 2019-06-06 1 4 2 1 5 1 [1,2] [1001,1002] [1,1]
|
||||
1 2019-06-06 1 4 2 1 5 0 [1,2] [1002,1003] [1,1]
|
||||
1 2019-06-06 1 4 2 1 6 0 [3] [2001] [1]
|
||||
-- empty
|
||||
[[1],[],[2]]
|
||||
[[1],[],[2]]
|
||||
[[1],[],[2],[],[3],[],[4],[],[5],[],[6],[],[7],[],[8],[],[9]]
|
||||
[[],[1],[],[2],[],[3],[],[4],[],[5],[],[6],[],[7],[],[8]]
|
||||
[[1],[2],[],[3]]
|
||||
|
@ -305,3 +305,11 @@ ARRAY JOIN
|
||||
Test.PuidVal AS PuidValArr;
|
||||
|
||||
DROP TABLE arr_tests_visits;
|
||||
|
||||
|
||||
select '-- empty';
|
||||
SELECT arrayEnumerateUniqRanked([['a'], [], ['a']]);
|
||||
SELECT arrayEnumerateUniqRanked([[1], [], [1]]);
|
||||
SELECT arrayEnumerateUniqRanked([[1], [], [1], [], [1], [], [1], [], [1], [], [1], [], [1], [], [1], [], [1]]);
|
||||
SELECT arrayEnumerateUniqRanked([[], [1], [], [1], [], [1], [], [1], [], [1], [], [1], [], [1], [], [1]]);
|
||||
SELECT arrayEnumerateUniqRanked([[1], [1], [], [1]]);
|
||||
|
Loading…
Reference in New Issue
Block a user