Fix arguments for AggregateFunctionQuantile/

This commit is contained in:
Nikolai Kochetov 2020-06-01 19:12:15 +03:00
parent ca3fb27b09
commit 35190e3f56
2 changed files with 8 additions and 8 deletions

View File

@ -70,17 +70,17 @@ AggregateFunctionPtr createAggregateFunctionQuantile(const std::string & name, c
WhichDataType which(argument_type); WhichDataType which(argument_type);
#define DISPATCH(TYPE) \ #define DISPATCH(TYPE) \
if (which.idx == TypeIndex::TYPE) return std::make_shared<Function<TYPE, true>>(argument_type, params); if (which.idx == TypeIndex::TYPE) return std::make_shared<Function<TYPE, true>>(argument_types, params);
FOR_NUMERIC_TYPES(DISPATCH) FOR_NUMERIC_TYPES(DISPATCH)
#undef DISPATCH #undef DISPATCH
if (which.idx == TypeIndex::Date) return std::make_shared<Function<DataTypeDate::FieldType, false>>(argument_type, params); if (which.idx == TypeIndex::Date) return std::make_shared<Function<DataTypeDate::FieldType, false>>(argument_types, params);
if (which.idx == TypeIndex::DateTime) return std::make_shared<Function<DataTypeDateTime::FieldType, false>>(argument_type, params); if (which.idx == TypeIndex::DateTime) return std::make_shared<Function<DataTypeDateTime::FieldType, false>>(argument_types, params);
if constexpr (supportDecimal<Function>()) if constexpr (supportDecimal<Function>())
{ {
if (which.idx == TypeIndex::Decimal32) return std::make_shared<Function<Decimal32, false>>(argument_type, params); if (which.idx == TypeIndex::Decimal32) return std::make_shared<Function<Decimal32, false>>(argument_types, params);
if (which.idx == TypeIndex::Decimal64) return std::make_shared<Function<Decimal64, false>>(argument_type, params); if (which.idx == TypeIndex::Decimal64) return std::make_shared<Function<Decimal64, false>>(argument_types, params);
if (which.idx == TypeIndex::Decimal128) return std::make_shared<Function<Decimal128, false>>(argument_type, params); if (which.idx == TypeIndex::Decimal128) return std::make_shared<Function<Decimal128, false>>(argument_types, params);
} }
throw Exception("Illegal type " + argument_type->getName() + " of argument for aggregate function " + name, throw Exception("Illegal type " + argument_type->getName() + " of argument for aggregate function " + name,

View File

@ -78,8 +78,8 @@ private:
DataTypePtr & argument_type; DataTypePtr & argument_type;
public: public:
AggregateFunctionQuantile(const DataTypePtr & argument_type_, const Array & params) AggregateFunctionQuantile(const DataTypes & argument_types, const Array & params)
: IAggregateFunctionDataHelper<Data, AggregateFunctionQuantile<Value, Data, Name, has_second_arg, FloatReturnType, returns_many>>({argument_type_}, params) : IAggregateFunctionDataHelper<Data, AggregateFunctionQuantile<Value, Data, Name, has_second_arg, FloatReturnType, returns_many>>(argument_types, params)
, levels(params, returns_many), level(levels.levels[0]), argument_type(this->argument_types[0]) , levels(params, returns_many), level(levels.levels[0]), argument_type(this->argument_types[0])
{ {
if (!returns_many && levels.size() > 1) if (!returns_many && levels.size() > 1)