mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 15:12:02 +00:00
AggregateFunctionGroupArrayInsertAt: fixed error [#CLICKHOUSE-3003].
This commit is contained in:
parent
3819216085
commit
1d090bd4e2
@ -118,7 +118,7 @@ public:
|
||||
if (arr_lhs.size() < arr_rhs.size())
|
||||
arr_lhs.resize(arr_rhs.size());
|
||||
|
||||
for (size_t i = 0, size = arr_lhs.size(); i < size; ++i)
|
||||
for (size_t i = 0, size = arr_rhs.size(); i < size; ++i)
|
||||
if (arr_lhs[i].isNull() && !arr_rhs[i].isNull())
|
||||
arr_lhs[i] = arr_rhs[i];
|
||||
}
|
||||
@ -128,6 +128,7 @@ public:
|
||||
const Array & arr = data(place).value;
|
||||
size_t size = arr.size();
|
||||
writeVarUInt(size, buf);
|
||||
|
||||
for (const Field & elem : arr)
|
||||
{
|
||||
if (elem.isNull())
|
||||
|
@ -11,3 +11,4 @@
|
||||
7 [0,0,0,0,0,0,0,7]
|
||||
8 [0,0,0,0,0,0,0,0,8]
|
||||
9 [0,0,0,0,0,0,0,0,0,9]
|
||||
0 0
|
||||
|
@ -2,3 +2,4 @@ SELECT groupArrayInsertAt(toString(number), number * 2) FROM (SELECT * FROM syst
|
||||
SELECT groupArrayInsertAt('-')(toString(number), number * 2) FROM (SELECT * FROM system.numbers LIMIT 10);
|
||||
SELECT groupArrayInsertAt([123])(range(number), number * 2) FROM (SELECT * FROM system.numbers LIMIT 10);
|
||||
SELECT number, groupArrayInsertAt(number, number) FROM (SELECT * FROM system.numbers LIMIT 10) GROUP BY number ORDER BY number;
|
||||
SELECT k, ignore(groupArrayInsertAt(x, x)) FROM (SELECT dummy AS k, randConstant() % 10 AS x FROM remote('127.0.0.{1,1}', system.one)) GROUP BY k ORDER BY k;
|
||||
|
Loading…
Reference in New Issue
Block a user