mirror of https://github.com/ByConity/ByConity
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())
|
if (arr_lhs.size() < arr_rhs.size())
|
||||||
arr_lhs.resize(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())
|
if (arr_lhs[i].isNull() && !arr_rhs[i].isNull())
|
||||||
arr_lhs[i] = arr_rhs[i];
|
arr_lhs[i] = arr_rhs[i];
|
||||||
}
|
}
|
||||||
|
@ -128,6 +128,7 @@ public:
|
||||||
const Array & arr = data(place).value;
|
const Array & arr = data(place).value;
|
||||||
size_t size = arr.size();
|
size_t size = arr.size();
|
||||||
writeVarUInt(size, buf);
|
writeVarUInt(size, buf);
|
||||||
|
|
||||||
for (const Field & elem : arr)
|
for (const Field & elem : arr)
|
||||||
{
|
{
|
||||||
if (elem.isNull())
|
if (elem.isNull())
|
||||||
|
|
|
@ -11,3 +11,4 @@
|
||||||
7 [0,0,0,0,0,0,0,7]
|
7 [0,0,0,0,0,0,0,7]
|
||||||
8 [0,0,0,0,0,0,0,0,8]
|
8 [0,0,0,0,0,0,0,0,8]
|
||||||
9 [0,0,0,0,0,0,0,0,0,9]
|
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('-')(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 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 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