You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-911 getAggCols needs to look into the objects
This commit is contained in:
committed by
Andrew Hutchings
parent
de457bfe4b
commit
c4269871fe
@ -55,15 +55,29 @@ void getAggCols(execplan::ParseTree* n, void* obj)
|
|||||||
SimpleFilter *sf = dynamic_cast<SimpleFilter*>(tn);
|
SimpleFilter *sf = dynamic_cast<SimpleFilter*>(tn);
|
||||||
ConstantFilter *cf = dynamic_cast<ConstantFilter*>(tn);
|
ConstantFilter *cf = dynamic_cast<ConstantFilter*>(tn);
|
||||||
if (sc)
|
if (sc)
|
||||||
|
{
|
||||||
list->push_back(sc);
|
list->push_back(sc);
|
||||||
|
}
|
||||||
else if (fc)
|
else if (fc)
|
||||||
|
{
|
||||||
|
fc->hasAggregate();
|
||||||
list->insert(list->end(), fc->aggColumnList().begin(), fc->aggColumnList().end());
|
list->insert(list->end(), fc->aggColumnList().begin(), fc->aggColumnList().end());
|
||||||
|
}
|
||||||
else if (ac)
|
else if (ac)
|
||||||
|
{
|
||||||
|
ac->hasAggregate();
|
||||||
list->insert(list->end(), ac->aggColumnList().begin(), ac->aggColumnList().end());
|
list->insert(list->end(), ac->aggColumnList().begin(), ac->aggColumnList().end());
|
||||||
|
}
|
||||||
else if (sf)
|
else if (sf)
|
||||||
|
{
|
||||||
|
sf->hasAggregate();
|
||||||
list->insert(list->end(), sf->aggColumnList().begin(), sf->aggColumnList().end());
|
list->insert(list->end(), sf->aggColumnList().begin(), sf->aggColumnList().end());
|
||||||
|
}
|
||||||
else if (cf)
|
else if (cf)
|
||||||
|
{
|
||||||
|
cf->hasAggregate();
|
||||||
list->insert(list->end(), cf->aggColumnList().begin(), cf->aggColumnList().end());
|
list->insert(list->end(), cf->aggColumnList().begin(), cf->aggColumnList().end());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -121,14 +121,22 @@ ostream& operator<<(ostream& output, const ConstantFilter& rhs)
|
|||||||
|
|
||||||
bool ConstantFilter::hasAggregate()
|
bool ConstantFilter::hasAggregate()
|
||||||
{
|
{
|
||||||
fAggColumnList.clear();
|
if (fAggColumnList.empty())
|
||||||
for (uint32_t i = 0; i < fFilterList.size(); i++)
|
|
||||||
{
|
{
|
||||||
if (fFilterList[i]->hasAggregate())
|
for (uint32_t i = 0; i < fFilterList.size(); i++)
|
||||||
{
|
{
|
||||||
return true;
|
if (fFilterList[i]->hasAggregate())
|
||||||
|
{
|
||||||
|
fAggColumnList.insert(fAggColumnList.end(),
|
||||||
|
fFilterList[i]->aggColumnList().begin(),
|
||||||
|
fFilterList[i]->aggColumnList().end());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (!fAggColumnList.empty())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -648,29 +648,41 @@ void SimpleFilter::setSimpleColumnList()
|
|||||||
|
|
||||||
bool SimpleFilter::hasAggregate()
|
bool SimpleFilter::hasAggregate()
|
||||||
{
|
{
|
||||||
AggregateColumn *lac = dynamic_cast<AggregateColumn*>(fLhs);
|
if (fAggColumnList.empty())
|
||||||
AggregateColumn *rac = dynamic_cast<AggregateColumn*>(fRhs);
|
{
|
||||||
fAggColumnList.clear();
|
AggregateColumn *lac = dynamic_cast<AggregateColumn*>(fLhs);
|
||||||
|
AggregateColumn *rac = dynamic_cast<AggregateColumn*>(fRhs);
|
||||||
|
fAggColumnList.clear();
|
||||||
|
|
||||||
if (lac)
|
if (lac)
|
||||||
|
{
|
||||||
|
fAggColumnList.insert(fAggColumnList.end(), lac);
|
||||||
|
}
|
||||||
|
if (rac)
|
||||||
|
{
|
||||||
|
fAggColumnList.insert(fAggColumnList.end(), rac);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fLhs)
|
||||||
|
{
|
||||||
|
if (fLhs->hasAggregate())
|
||||||
|
fAggColumnList.insert(fAggColumnList.end(),
|
||||||
|
fLhs->aggColumnList().begin(),
|
||||||
|
fLhs->aggColumnList().end());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fRhs)
|
||||||
|
{
|
||||||
|
if (fRhs->hasAggregate())
|
||||||
|
fAggColumnList.insert(fAggColumnList.end(),
|
||||||
|
fRhs->aggColumnList().begin(),
|
||||||
|
fRhs->aggColumnList().end());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!fAggColumnList.empty())
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (fLhs)
|
|
||||||
{
|
|
||||||
if (fLhs->hasAggregate())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (rac)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (fRhs)
|
|
||||||
{
|
|
||||||
if (fRhs->hasAggregate())
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user