You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-3435 Don't put nested aggregate into implied group by. Use the csep group by instead of groupByColumnVec.
This commit is contained in:
@ -514,11 +514,24 @@ void WindowFunctionStep::checkWindowFunction(CalpontSelectExecutionPlan* csep, J
|
|||||||
// no group by by inserting a group by for window parameters.
|
// no group by by inserting a group by for window parameters.
|
||||||
if (hasAggregation)
|
if (hasAggregation)
|
||||||
{
|
{
|
||||||
uint32_t tupleKey = getTupleKey(jobInfo, *j, true);
|
// If an argument is an AggregateColumn, don't group by it.
|
||||||
if (find(jobInfo.groupByColVec.begin(), jobInfo.groupByColVec.end(), tupleKey)
|
if (dynamic_cast<AggregateColumn*>(j->get()) == NULL)
|
||||||
== jobInfo.groupByColVec.end())
|
|
||||||
{
|
{
|
||||||
jobInfo.groupByColVec.push_back(tupleKey);
|
bool bFound = false;
|
||||||
|
for (std::vector<SRCP>::iterator igpc = csep->groupByCols().begin();
|
||||||
|
igpc < csep->groupByCols().end();
|
||||||
|
++igpc)
|
||||||
|
{
|
||||||
|
if (*igpc->get() == *j->get())
|
||||||
|
{
|
||||||
|
bFound = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bFound)
|
||||||
|
{
|
||||||
|
csep->groupByCols().push_back(*j);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user