Apply suggestions from code review

Co-authored-by: Dmitry Novik <n0vik@clickhouse.com>
This commit is contained in:
Vladimir C 2022-11-28 15:47:32 +01:00 committed by GitHub
parent 2b138388a9
commit db2aad6f59
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,14 +79,14 @@ FunctionNodePtr createResolvedAggregateFunction(const String & name, const Query
function_node->resolveAsAggregateFunction(aggregate_function, aggregate_function->getReturnType());
function_node->getArguments().getNodes() = { argument };
function_node->getArgumentsNode() = std::make_shared<ListNode>(QueryTreeNodes{argument});
function_node->getArguments().getNodes() = { argument };
if (!parameters.empty())
{
QueryTreeNodes parameter_nodes;
for (const auto & param : parameters)
parameter_nodes.emplace_back(std::make_shared<ConstantNode>(param));
function_node->getParametersNode() = std::make_shared<ListNode>(std::move(parameter_nodes));
function_node->getParameters().getNodes() = std::move(parameter_nodes);
}
return function_node;