1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-08 14:22:09 +03:00

MCOL-3343 Try adding aggregate result to jobInfo.nonConstDelCol vector

This commit is contained in:
David Hall
2019-06-12 14:17:31 -05:00
parent 992b696a66
commit ea6592ea08

View File

@@ -397,6 +397,7 @@ void checkHavingClause(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs, void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs,
const vector<AggregateColumn*>& aggs, const vector<AggregateColumn*>& aggs,
const vector<WindowFunctionColumn*>& wcs,
JobInfo& jobInfo) JobInfo& jobInfo)
{ {
// append the simple columns if not already projected // append the simple columns if not already projected
@@ -426,10 +427,14 @@ void preProcessFunctionOnAggregation(const vector<SimpleColumn*>& scs,
} }
} }
// append the aggregate columns in arithmetic/function cloulmn to the projection list // append the aggregate columns in arithmetic/function column to the projection list
for (vector<AggregateColumn*>::const_iterator i = aggs.begin(); i != aggs.end(); i++) for (vector<AggregateColumn*>::const_iterator i = aggs.begin(); i != aggs.end(); i++)
{ {
addAggregateColumn(*i, -1, jobInfo.projectionCols, jobInfo); addAggregateColumn(*i, -1, jobInfo.projectionCols, jobInfo);
if (wcs.size() > 0)
{
jobInfo.nonConstDelCols.push_back(SRCP((*i)->clone()));
}
} }
} }
@@ -481,12 +486,12 @@ void checkReturnedColumns(CalpontSelectExecutionPlan* csep, JobInfo& jobInfo)
if (ac != NULL && ac->aggColumnList().size() > 0) if (ac != NULL && ac->aggColumnList().size() > 0)
{ {
jobInfo.nonConstCols[i]->outputIndex(i); jobInfo.nonConstCols[i]->outputIndex(i);
preProcessFunctionOnAggregation(ac->simpleColumnList(), ac->aggColumnList(), jobInfo); preProcessFunctionOnAggregation(ac->simpleColumnList(), ac->aggColumnList(), ac->windowfunctionColumnList(), jobInfo);
} }
else if (fc != NULL && fc->aggColumnList().size() > 0) else if (fc != NULL && fc->aggColumnList().size() > 0)
{ {
jobInfo.nonConstCols[i]->outputIndex(i); jobInfo.nonConstCols[i]->outputIndex(i);
preProcessFunctionOnAggregation(fc->simpleColumnList(), fc->aggColumnList(), jobInfo); preProcessFunctionOnAggregation(fc->simpleColumnList(), fc->aggColumnList(), fc->windowfunctionColumnList(), jobInfo);
} }
} }
} }