mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #28904 from azat/higher-order-array-func-consts-fix
Fix higher-order array functions (arrayCompact/arrayDifference/arrayCumSumNonNegative) with consts
This commit is contained in:
commit
294f4c897b
@ -16,7 +16,6 @@ namespace ErrorCodes
|
||||
|
||||
struct ArrayCompactImpl
|
||||
{
|
||||
static bool useDefaultImplementationForConstants() { return true; }
|
||||
static bool needBoolean() { return false; }
|
||||
static bool needExpression() { return false; }
|
||||
static bool needOneArray() { return false; }
|
||||
@ -129,6 +128,7 @@ struct ArrayCompactImpl
|
||||
{
|
||||
ColumnPtr res;
|
||||
|
||||
mapped = mapped->convertToFullColumnIfConst();
|
||||
if (!(executeType< UInt8 >(mapped, array, res) ||
|
||||
executeType< UInt16>(mapped, array, res) ||
|
||||
executeType< UInt32>(mapped, array, res) ||
|
||||
|
@ -19,7 +19,6 @@ namespace ErrorCodes
|
||||
*/
|
||||
struct ArrayCumSumNonNegativeImpl
|
||||
{
|
||||
static bool useDefaultImplementationForConstants() { return true; }
|
||||
static bool needBoolean() { return false; }
|
||||
static bool needExpression() { return false; }
|
||||
static bool needOneArray() { return false; }
|
||||
@ -100,6 +99,7 @@ struct ArrayCumSumNonNegativeImpl
|
||||
{
|
||||
ColumnPtr res;
|
||||
|
||||
mapped = mapped->convertToFullColumnIfConst();
|
||||
if (executeType< UInt8 , UInt64>(mapped, array, res) ||
|
||||
executeType< UInt16, UInt64>(mapped, array, res) ||
|
||||
executeType< UInt32, UInt64>(mapped, array, res) ||
|
||||
|
@ -20,7 +20,6 @@ namespace ErrorCodes
|
||||
*/
|
||||
struct ArrayDifferenceImpl
|
||||
{
|
||||
static bool useDefaultImplementationForConstants() { return true; }
|
||||
static bool needBoolean() { return false; }
|
||||
static bool needExpression() { return false; }
|
||||
static bool needOneArray() { return false; }
|
||||
@ -129,6 +128,7 @@ struct ArrayDifferenceImpl
|
||||
{
|
||||
ColumnPtr res;
|
||||
|
||||
mapped = mapped->convertToFullColumnIfConst();
|
||||
if (executeType< UInt8 , Int16>(mapped, array, res) ||
|
||||
executeType< UInt16, Int32>(mapped, array, res) ||
|
||||
executeType< UInt32, Int64>(mapped, array, res) ||
|
||||
|
@ -7,3 +7,5 @@
|
||||
[1,2,1]
|
||||
[2,1]
|
||||
[1,2,3,4,5]
|
||||
[0]
|
||||
[0]
|
||||
|
@ -7,3 +7,5 @@ select arrayCompact([1,1,2]);
|
||||
select arrayCompact([1,2,1]);
|
||||
select arrayCompact([2,1,1]);
|
||||
select arrayCompact([1,2,2,3,3,3,4,4,4,4,5,5,5,5,5]);
|
||||
SELECT arrayCompact(x->0, [NULL]);
|
||||
SELECT toString(arrayCompact(x->0, [NULL]));
|
||||
|
@ -0,0 +1 @@
|
||||
[0,0]
|
@ -0,0 +1 @@
|
||||
SELECT toString(arrayDifference(x->0, [1, 2]));
|
@ -0,0 +1 @@
|
||||
[0,0]
|
@ -0,0 +1 @@
|
||||
SELECT toString(arrayCumSumNonNegative(x->0, [1, 2]));
|
Loading…
Reference in New Issue
Block a user