1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-597 Fix up Windows Functions

This commit is contained in:
David Hall
2017-03-21 16:27:09 -05:00
parent a3c4503bc9
commit d7da34c249
7 changed files with 576 additions and 396 deletions

View File

@ -121,6 +121,11 @@ void WF_lead_lag<T>::parseParms(const std::vector<execplan::SRCP>& parms)
{
// lead | lag
fLead = 1;
fRespectNulls = true;
fDefNull = false;
fDefault = (T)0;
fOffsetNull = false;
fOffset = 0;
if (fFunctionId == WF__LAG)
fLead = -1;
@ -148,6 +153,32 @@ void WF_lead_lag<T>::parseParms(const std::vector<execplan::SRCP>& parms)
idbassert(cc != NULL);
bool isNull = false; // dummy, harded coded
fRespectNulls = (cc->getIntVal(fRow, isNull) > 0);
#if 0
// parms[1]: offset
for (std::vector<execplan::SRCP>::size_type i = 1/*ignore 0th element*/; i < parms.size(); ++i)
{
ConstantColumn* cc = dynamic_cast<ConstantColumn*>(parms[i].get());
if (cc != NULL)
{
fOffset = cc->getIntVal(fRow, fOffsetNull) * fLead; // row not used, no need to setData.
continue;
}
cc = dynamic_cast<ConstantColumn*>(parms[i].get());
if (cc != NULL)
{
getConstValue(cc, fDefault, fDefNull);
continue;
}
// IGNORE/RESPECT nulls is currently broken in the front end
cc = dynamic_cast<ConstantColumn*>(parms[i].get());
if (cc != NULL)
{
bool isNull = false; // dummy, harded coded
fRespectNulls = (cc->getIntVal(fRow, isNull) > 0);
}
}
#endif
}