mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-18 20:32:43 +00:00
Merge pull request #6928 from proller/fix27
CLICKHOUSE-4652 Another fix for АrrayEnumerateUniqRanked with empty arrays
(cherry picked from commit ba40858094
)
This commit is contained in:
parent
1712ef0d5d
commit
1989b50166
@ -336,10 +336,6 @@ void FunctionArrayEnumerateRankedExtended<Derived>::executeMethodImpl(
|
||||
/// Skipping offsets if no data in this array
|
||||
if (prev_off == off)
|
||||
{
|
||||
|
||||
if (depth_to_look > 2)
|
||||
want_clear = true;
|
||||
|
||||
if (depth_to_look >= 2)
|
||||
{
|
||||
/// Advance to the next element of the parent array.
|
||||
@ -357,6 +353,7 @@ void FunctionArrayEnumerateRankedExtended<Derived>::executeMethodImpl(
|
||||
{
|
||||
last_offset_by_depth[depth] = (*offsets_by_depth[depth])[current_offset_n_by_depth[depth]];
|
||||
++current_offset_n_by_depth[depth];
|
||||
want_clear = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -284,3 +284,6 @@ a1,a2 12 [1,2]
|
||||
[[1],[],[2],[],[3],[],[4],[],[5],[],[6],[],[7],[],[8],[],[9]]
|
||||
[[],[1],[],[2],[],[3],[],[4],[],[5],[],[6],[],[7],[],[8]]
|
||||
[[1],[2],[],[3]]
|
||||
-- empty corner
|
||||
[[],[1],[]] [[],[1],[]]
|
||||
[[1]] [[1]]
|
||||
|
@ -313,3 +313,6 @@ 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]]);
|
||||
|
||||
select '-- empty corner';
|
||||
SELECT a, arrayEnumerateUniqRanked(a) FROM ( SELECT * FROM ( SELECT [[],[1],[]] AS a UNION ALL SELECT [[1]] AS a ) ORDER BY a ASC );
|
||||
|
Loading…
Reference in New Issue
Block a user