Fix run issues

This commit is contained in:
Yarik Briukhovetskyi 2024-12-03 20:30:06 +01:00 committed by GitHub
parent b8f1110455
commit d6480b846c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 9 deletions

View File

@ -49,8 +49,6 @@ class GroupConcatImpl : public IAggregateFunctionDataHelper<GroupConcatData<has_
{
static constexpr auto name = "groupConcat";
constexpr static std::array<const char *, 2> names_and_aliases = { "groupConcat", "group_concat" };
SerializationPtr serialization;
UInt64 limit;
const String delimiter;
@ -61,9 +59,10 @@ public:
String getName() const override;
static std::array<const char *, 2> getNameAndAliases()
static const std::vector<std::string>& getNameAndAliases()
{
return names_and_aliases;
static const std::vector<std::string> aliases = {"groupConcat", "group_concat"};
return aliases;
}
void add(AggregateDataPtr place, const IColumn ** columns, size_t row_num, Arena * arena) const override;

View File

@ -648,11 +648,10 @@ QueryTreeNodePtr QueryTreeBuilder::buildExpression(const ASTPtr & expression, co
}
else
{
const char * name = function->name.c_str();
// Check if the function is groupConcat with exactly two arguments
if (std::any_of(GroupConcatImpl<false>::getNameAndAliases().begin(),
GroupConcatImpl<false>::getNameAndAliases().end(),
[name](const char *alias) { return std::strcmp(name, alias) == 0; })
const auto & group_concat_aliases = GroupConcatImpl<false>::getNameAndAliases();
if (!function->name.empty() && std::any_of(
group_concat_aliases.begin(), group_concat_aliases.end(),
[&](const std::string &s) { return s == function->name; })
&& function->arguments && function->arguments->children.size() == 2)
{
result = setFirstArgumentAsParameter(function, context);