1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-02 17:22:27 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -17,7 +17,6 @@
// $Id: frameboundrow.cpp 3932 2013-06-25 16:08:10Z xlou $
//#define NDEBUG
#include <cassert>
#include <cmath>
@ -36,119 +35,108 @@ using namespace ordering;
#include "treenode.h"
#include "frameboundrow.h"
namespace windowfunction
{
int64_t FrameBoundRow::getBound(int64_t b, int64_t e, int64_t c)
{
return c;
return c;
}
const string FrameBoundRow::toString() const
{
return FrameBound::toString();
return FrameBound::toString();
}
int64_t FrameBoundConstantRow::getBound(int64_t b, int64_t e, int64_t c)
{
if (fBoundType < WF__CURRENT_ROW)
{
if (fOffset <= (c - b))
c -= fOffset;
else
c = b - (!fStart ? 1 : 0);
}
if (fBoundType < WF__CURRENT_ROW)
{
if (fOffset <= (c - b))
c -= fOffset;
else
{
if (fOffset <= (e - c))
c += fOffset;
else
c = e + (fStart ? 1 : 0);
}
c = b - (!fStart ? 1 : 0);
}
else
{
if (fOffset <= (e - c))
c += fOffset;
else
c = e + (fStart ? 1 : 0);
}
return c;
return c;
}
const string FrameBoundConstantRow::toString() const
{
ostringstream oss;
oss << fOffset << " " << FrameBound::toString();
return oss.str();
ostringstream oss;
oss << fOffset << " " << FrameBound::toString();
return oss.str();
}
template<typename T>
template <typename T>
int64_t FrameBoundExpressionRow<T>::getBound(int64_t b, int64_t e, int64_t c)
{
// set row data
// get expression int value
fRow.setData(getPointer(fRowData->at(c)));
// set row data
// get expression int value
fRow.setData(getPointer(fRowData->at(c)));
if (fRow.isNullValue(fExprIdx))
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, "NULL"),
ERR_WF_BOUND_OUT_OF_RANGE);
if (fRow.isNullValue(fExprIdx))
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, "NULL"),
ERR_WF_BOUND_OUT_OF_RANGE);
getOffset();
getOffset();
if (fOffset < 0)
{
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, fOffset),
ERR_WF_BOUND_OUT_OF_RANGE);
}
if (fOffset < 0)
{
throw IDBExcept(IDBErrorInfo::instance()->errorMsg(ERR_WF_BOUND_OUT_OF_RANGE, fOffset),
ERR_WF_BOUND_OUT_OF_RANGE);
}
return FrameBoundConstantRow::getBound(b, e, c);
return FrameBoundConstantRow::getBound(b, e, c);
}
template<typename T>
template <typename T>
const string FrameBoundExpressionRow<T>::toString() const
{
ostringstream oss;
oss << "value_expr " << FrameBound::toString();
return oss.str();
ostringstream oss;
oss << "value_expr " << FrameBound::toString();
return oss.str();
}
template<typename T> void FrameBoundExpressionRow<T>::getOffset()
template <typename T>
void FrameBoundExpressionRow<T>::getOffset()
{
}
template<> void FrameBoundExpressionRow<int64_t>::getOffset()
template <>
void FrameBoundExpressionRow<int64_t>::getOffset()
{
fOffset = fRow.getIntField(fExprIdx);
fOffset = fRow.getIntField(fExprIdx);
}
template<> void FrameBoundExpressionRow<uint64_t>::getOffset()
template <>
void FrameBoundExpressionRow<uint64_t>::getOffset()
{
fOffset = fRow.getUintField(fExprIdx);
fOffset = fRow.getUintField(fExprIdx);
}
template<> void FrameBoundExpressionRow<double>::getOffset()
template <>
void FrameBoundExpressionRow<double>::getOffset()
{
fOffset = (int64_t) fRow.getDoubleField(fExprIdx);
fOffset = (int64_t)fRow.getDoubleField(fExprIdx);
}
template<> void FrameBoundExpressionRow<float>::getOffset()
template <>
void FrameBoundExpressionRow<float>::getOffset()
{
fOffset = (int64_t) fRow.getFloatField(fExprIdx);
fOffset = (int64_t)fRow.getFloatField(fExprIdx);
}
template class FrameBoundExpressionRow<int64_t>;
template class FrameBoundExpressionRow<double>;
template class FrameBoundExpressionRow<float>;
template class FrameBoundExpressionRow<uint64_t>;
} //namespace
} // namespace windowfunction
// vim:ts=4 sw=4: