Skip to content

Commit

Permalink
avoid name collisions in naming aggregate result
Browse files Browse the repository at this point in the history
  • Loading branch information
lgbo-ustc committed Aug 16, 2024
1 parent 5f4e558 commit 72cfbe8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cpp-ch/local-engine/Parser/AggregateRelParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ void AggregateRelParser::addPreProjection()

void AggregateRelParser::buildAggregateDescriptions(AggregateDescriptions & descriptions)
{
auto build_result_column_name = [](const String & function_name, const Array & params, const Strings & arg_names, substrait::AggregationPhase phase)
auto build_result_column_name = [this](const String & function_name, const Array & params, const Strings & arg_names, substrait::AggregationPhase phase)
{
if (phase == substrait::AggregationPhase::AGGREGATION_PHASE_INTERMEDIATE_TO_RESULT)
{
Expand All @@ -219,7 +219,8 @@ void AggregateRelParser::buildAggregateDescriptions(AggregateDescriptions & desc
result += "(";
result += boost::algorithm::join(arg_names, ",");
result += ")";
return result;
// Make the name unique to avoid name collision(#issue 6878).
return this->getUniqueName(result);
};

for (auto & agg_info : aggregates)
Expand Down

0 comments on commit 72cfbe8

Please sign in to comment.