You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +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);
|
||||
ConstantFilter *cf = dynamic_cast<ConstantFilter*>(tn);
|
||||
if (sc)
|
||||
{
|
||||
list->push_back(sc);
|
||||
}
|
||||
else if (fc)
|
||||
{
|
||||
fc->hasAggregate();
|
||||
list->insert(list->end(), fc->aggColumnList().begin(), fc->aggColumnList().end());
|
||||
}
|
||||
else if (ac)
|
||||
{
|
||||
ac->hasAggregate();
|
||||
list->insert(list->end(), ac->aggColumnList().begin(), ac->aggColumnList().end());
|
||||
}
|
||||
else if (sf)
|
||||
{
|
||||
sf->hasAggregate();
|
||||
list->insert(list->end(), sf->aggColumnList().begin(), sf->aggColumnList().end());
|
||||
}
|
||||
else if (cf)
|
||||
{
|
||||
cf->hasAggregate();
|
||||
list->insert(list->end(), cf->aggColumnList().begin(), cf->aggColumnList().end());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -121,14 +121,22 @@ ostream& operator<<(ostream& output, const ConstantFilter& rhs)
|
||||
|
||||
bool ConstantFilter::hasAggregate()
|
||||
{
|
||||
fAggColumnList.clear();
|
||||
for (uint32_t i = 0; i < fFilterList.size(); i++)
|
||||
if (fAggColumnList.empty())
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -648,29 +648,41 @@ void SimpleFilter::setSimpleColumnList()
|
||||
|
||||
bool SimpleFilter::hasAggregate()
|
||||
{
|
||||
AggregateColumn *lac = dynamic_cast<AggregateColumn*>(fLhs);
|
||||
AggregateColumn *rac = dynamic_cast<AggregateColumn*>(fRhs);
|
||||
fAggColumnList.clear();
|
||||
if (fAggColumnList.empty())
|
||||
{
|
||||
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;
|
||||
}
|
||||
else if (fLhs)
|
||||
{
|
||||
if (fLhs->hasAggregate())
|
||||
return true;
|
||||
}
|
||||
|
||||
if (rac)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (fRhs)
|
||||
{
|
||||
if (fRhs->hasAggregate())
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user