| 284 | } |
| 285 | |
| 286 | std::tuple<AggregateFunctionPtr, Array, DataTypes> decodeAggregateFunction(ReadBuffer & buf, size_t & complexity) |
| 287 | { |
| 288 | String function_name; |
| 289 | readStringBinary(function_name, buf); |
| 290 | size_t num_parameters = 0; |
| 291 | readVarUInt(num_parameters, buf); |
| 292 | if (num_parameters > MAX_ARRAY_SIZE) |
| 293 | throw Exception(ErrorCodes::INCORRECT_DATA, "Too many parameters during AggregateFunction type decoding: {}. Maximum: {}", num_parameters, MAX_ARRAY_SIZE); |
| 294 | |
| 295 | Array parameters; |
| 296 | parameters.reserve(num_parameters); |
| 297 | for (size_t i = 0; i != num_parameters; ++i) |
| 298 | parameters.push_back(decodeField(buf)); |
| 299 | size_t num_arguments = 0; |
| 300 | readVarUInt(num_arguments, buf); |
| 301 | if (num_arguments > MAX_ARRAY_SIZE) |
| 302 | throw Exception(ErrorCodes::INCORRECT_DATA, "Too many function arguments during AggregateFunction type decoding: {}. Maximum: {}", num_arguments, MAX_ARRAY_SIZE); |
| 303 | |
| 304 | DataTypes arguments_types; |
| 305 | arguments_types.reserve(num_arguments); |
| 306 | for (size_t i = 0; i != num_arguments; ++i) |
| 307 | arguments_types.push_back(decodeDataType(buf, complexity)); |
| 308 | AggregateFunctionProperties properties; |
| 309 | auto action = NullsAction::EMPTY; |
| 310 | auto function = AggregateFunctionFactory::instance().get(function_name, action, arguments_types, parameters, properties); |
| 311 | return {function, parameters, arguments_types}; |
| 312 | } |
| 313 | |
| 314 | template <bool encode_for_hash_calculation> |
| 315 | void encodeDataTypeImpl(const DataTypePtr & type, WriteBuffer & buf) |
no test coverage detected