From e6c283e7dfa14f746c4472c5f582b5c16fb61077 Mon Sep 17 00:00:00 2001 From: Dmitry Novik Date: Tue, 29 Nov 2022 16:38:06 +0000 Subject: [PATCH] Fix AggregateFunctionMinMaxAny::createResultType --- src/AggregateFunctions/AggregateFunctionMinMaxAny.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/AggregateFunctions/AggregateFunctionMinMaxAny.h b/src/AggregateFunctions/AggregateFunctionMinMaxAny.h index 63d6f84d259..485903f25c5 100644 --- a/src/AggregateFunctions/AggregateFunctionMinMaxAny.h +++ b/src/AggregateFunctions/AggregateFunctionMinMaxAny.h @@ -1219,7 +1219,7 @@ private: public: explicit AggregateFunctionsSingleValue(const DataTypePtr & type) - : IAggregateFunctionDataHelper>({type}, {}, createResultType()) + : IAggregateFunctionDataHelper>({type}, {}, createResultType(type)) , serialization(type->getDefaultSerialization()) { if (StringRef(Data::name()) == StringRef("min") @@ -1233,12 +1233,11 @@ public: String getName() const override { return Data::name(); } - DataTypePtr createResultType() const + static DataTypePtr createResultType(const DataTypePtr & type_) { - auto result_type = this->argument_types.at(0); if constexpr (Data::is_nullable) - return makeNullable(result_type); - return result_type; + return makeNullable(type_); + return type_; } void add(AggregateDataPtr __restrict place, const IColumn ** columns, size_t row_num, Arena * arena) const override