support nullable arguments in function initializeAggregation

This commit is contained in:
Anton Popov 2021-10-14 15:07:50 +03:00
parent 5802037f1e
commit 4d020c96e0
3 changed files with 15 additions and 0 deletions

View File

@ -40,6 +40,7 @@ public:
bool isSuitableForShortCircuitArgumentsExecution(const DataTypesWithConstInfo & /*arguments*/) const override { return true; }
bool useDefaultImplementationForConstants() const override { return true; }
bool useDefaultImplementationForNulls() const override { return false; }
ColumnNumbers getArgumentsThatAreAlwaysConstant() const override { return {0}; }
DataTypePtr getReturnTypeImpl(const ColumnsWithTypeAndName & arguments) const override;

View File

@ -0,0 +1,6 @@
1
AggregateFunction(uniqExact, Nullable(String))
1
AggregateFunction(uniqExact, Nullable(UInt8))
1
1

View File

@ -0,0 +1,8 @@
SELECT finalizeAggregation(initializeAggregation('uniqExactState', toNullable('foo')));
SELECT toTypeName(initializeAggregation('uniqExactState', toNullable('foo')));
SELECT finalizeAggregation(initializeAggregation('uniqExactState', toNullable(123)));
SELECT toTypeName(initializeAggregation('uniqExactState', toNullable(123)));
SELECT initializeAggregation('uniqExactState', toNullable('foo')) = arrayReduce('uniqExactState', [toNullable('foo')]);
SELECT initializeAggregation('uniqExactState', toNullable(123)) = arrayReduce('uniqExactState', [toNullable(123)]);