1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

chore(codestyle): mark virtual methods as override

This commit is contained in:
Aleksei Antipovskii
2024-09-12 12:27:02 +02:00
committed by Leonid Fedorov
parent ad80ab40aa
commit 0ab03c7258
303 changed files with 4085 additions and 4886 deletions

View File

@ -405,7 +405,7 @@ int64_t Func_mod::getIntVal(Row& row, FunctionParm& parm, bool& isNull,
return mod;
}
uint64_t Func_mod::getUIntVal(Row& row, FunctionParm& parm, bool& isNull,
uint64_t Func_mod::getUintVal(Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType& operationColType)
{
if (parm.size() < 2)

View File

@ -60,12 +60,13 @@ FuncExpWrapper::FuncExpWrapper(const FuncExpWrapper& f)
rcs[i].reset(f.rcs[i]->clone());
}
FuncExpWrapper::~FuncExpWrapper()
{
}
FuncExpWrapper::~FuncExpWrapper() = default;
void FuncExpWrapper::operator=(const FuncExpWrapper& f)
FuncExpWrapper& FuncExpWrapper::operator=(const FuncExpWrapper& f)
{
if (&f == this)
return *this;
uint32_t i;
filters.resize(f.filters.size());
@ -77,6 +78,7 @@ void FuncExpWrapper::operator=(const FuncExpWrapper& f)
for (i = 0; i < f.rcs.size(); i++)
rcs[i].reset(f.rcs[i]->clone());
return *this;
}
void FuncExpWrapper::serialize(ByteStream& bs) const
@ -101,12 +103,12 @@ void FuncExpWrapper::deserialize(ByteStream& bs)
bs >> rcsCount;
for (i = 0; i < fCount; i++)
filters.push_back(boost::shared_ptr<ParseTree>(ObjectReader::createParseTree(bs)));
filters.emplace_back(ObjectReader::createParseTree(bs));
for (i = 0; i < rcsCount; i++)
{
ReturnedColumn* rc = (ReturnedColumn*)ObjectReader::createTreeNode(bs);
rcs.push_back(boost::shared_ptr<ReturnedColumn>(rc));
auto* rc = (ReturnedColumn*)ObjectReader::createTreeNode(bs);
rcs.emplace_back(rc);
}
}
@ -133,4 +135,4 @@ void FuncExpWrapper::addReturnedColumn(const boost::shared_ptr<ReturnedColumn>&
rcs.push_back(rc);
}
}; // namespace funcexp
} // namespace funcexp

View File

@ -47,12 +47,12 @@ class FuncExpWrapper : public messageqcpp::Serializeable
public:
FuncExpWrapper();
FuncExpWrapper(const FuncExpWrapper&);
virtual ~FuncExpWrapper();
~FuncExpWrapper() override;
void operator=(const FuncExpWrapper&);
FuncExpWrapper& operator=(const FuncExpWrapper&);
void serialize(messageqcpp::ByteStream&) const;
void deserialize(messageqcpp::ByteStream&);
void serialize(messageqcpp::ByteStream&) const override;
void deserialize(messageqcpp::ByteStream&) override;
bool evaluate(rowgroup::Row*);
inline bool evaluateFilter(uint32_t num, rowgroup::Row* r);

View File

@ -28,7 +28,7 @@
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#include <cinttypes>
#include <boost/algorithm/string/case_conv.hpp>
#include <boost/tokenizer.hpp>
@ -40,9 +40,7 @@
#ifndef ULONGLONG_MAX
#define ULONGLONG_MAX ulonglong_max
#endif
namespace funcexp
{
namespace helpers
namespace funcexp::helpers
{
// 10 ** i
const int64_t powerOf10_c[] = {1ll,
@ -242,7 +240,7 @@ inline int16_t convert_mysql_mode_to_modeflags(int16_t mode)
//
// This is a mirror of calc_week, at a later date we should use sql_time.h
inline uint32_t calc_mysql_week(uint32_t year, uint32_t month, uint32_t day, int16_t modeflags,
uint32_t* weekyear = 0)
uint32_t* weekyear = nullptr)
{
// need to make sure that the date is valid
if (!dataconvert::isDateValid(day, month, year))
@ -268,7 +266,7 @@ inline uint32_t calc_mysql_week(uint32_t year, uint32_t month, uint32_t day, int
if (!week_year && ((first_weekday && weekday != 0) || (!first_weekday && weekday >= 4)))
return 0;
week_year = 1;
week_year = true;
if (weekyear)
{
@ -360,12 +358,12 @@ inline bool calc_time_diff(int64_t time1, int64_t time2, int l_sign, long long*
(long long)(1000000) +
(long long)msec1 - l_sign * (long long)msec2;
neg = 0;
neg = false;
if (microseconds < 0)
{
microseconds = -microseconds;
neg = 1;
neg = true;
}
*seconds_out = microseconds / 1000000L;
@ -485,7 +483,7 @@ inline int getNumbers(const std::string& expr, int64_t* array, execplan::OpType
if (funcType == execplan::OP_SUB)
funcNeg = -1;
if (expr.size() == 0)
if (expr.empty())
return 0;
// @bug 4703 reworked this code to avoid use of incrementally
@ -496,10 +494,8 @@ inline int getNumbers(const std::string& expr, int64_t* array, execplan::OpType
int64_t number = 0;
int neg = 1;
for (unsigned int i = 0; i < expr.size(); i++)
for (auto value : expr)
{
char value = expr[i];
if ((value >= '0' && value <= '9'))
{
foundNumber = true;
@ -553,7 +549,7 @@ inline int getNumbers(const std::string& expr, int* array, execplan::OpType func
if (funcType == execplan::OP_SUB)
funcNeg = -1;
if (expr.size() == 0)
if (expr.empty())
return 0;
// @bug 4703 reworked this code to avoid use of incrementally
@ -564,10 +560,8 @@ inline int getNumbers(const std::string& expr, int* array, execplan::OpType func
int number = 0;
int neg = 1;
for (unsigned int i = 0; i < expr.size(); i++)
for (char value : expr)
{
char value = expr[i];
if ((value >= '0' && value <= '9'))
{
foundNumber = true;
@ -614,56 +608,51 @@ inline int getNumbers(const std::string& expr, int* array, execplan::OpType func
inline int dayOfWeek(std::string day) // Sunday = 0
{
int value = -1;
boost::to_lower(day);
if (day == "sunday" || day == "sun")
{
value = 0;
return 0;
}
else if (day == "monday" || day == "mon")
{
value = 1;
return 1;
}
else if (day == "tuesday" || day == "tue")
{
value = 2;
return 2;
}
else if (day == "wednesday" || day == "wed")
{
value = 3;
return 3;
}
else if (day == "thursday" || day == "thu")
{
value = 4;
return 4;
}
else if (day == "friday" || day == "fri")
{
value = 5;
return 5;
}
else if (day == "saturday" || day == "sat")
{
value = 6;
}
else
{
value = -1;
return 6;
}
return value;
return -1;
}
inline string intToString(int64_t i)
{
char buf[32];
snprintf(buf, 32, "%" PRId64 "", i);
snprintf(buf, sizeof(buf), "%" PRId64 "", i);
return buf;
}
inline string uintToString(uint64_t i)
{
char buf[32];
snprintf(buf, 32, "%" PRIu64 "", i);
snprintf(buf, sizeof(buf), "%" PRIu64 "", i);
return buf;
}
@ -672,7 +661,7 @@ inline string doubleToString(double d)
// double's can be *really* long to print out. Max mysql
// is e308 so allow for 308 + 36 decimal places minimum.
char buf[384];
snprintf(buf, 384, "%f", d);
snprintf(buf, sizeof(buf), "%f", d);
return buf;
}
@ -681,7 +670,7 @@ inline string longDoubleToString(long double ld)
// long double's can be *really* long to print out. Max mysql
// is e308 so allow for 308 + 36 decimal places minimum.
char buf[384];
snprintf(buf, 384, "%Lf", ld);
snprintf(buf, sizeof(buf), "%Lf", ld);
return buf;
}
@ -691,5 +680,4 @@ const std::string IDB_date_format(const dataconvert::DateTime&, const std::strin
const std::string timediff(int64_t, int64_t, bool isDateTime = true);
const char* convNumToStr(int64_t, char*, int);
} // namespace helpers
} // namespace funcexp
} // namespace funcexp::helpers

View File

@ -68,10 +68,8 @@ class Func
{
public:
Func();
Func(const std::string& funcName);
virtual ~Func()
{
}
explicit Func(const std::string& funcName);
virtual ~Func() = default;
const std::string funcName() const
{
@ -116,7 +114,7 @@ class Func
virtual std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct) = 0;
utils::NullString getNullStrVal(rowgroup::Row& row, FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct)
{
bool isNull;
std::string val = getStrVal(row, fp, isNull, op_ct);
@ -220,10 +218,8 @@ class Func
class ParmTSInt64 : public datatypes::TSInt64Null
{
public:
ParmTSInt64()
{
}
ParmTSInt64(rowgroup::Row& row, const execplan::SPTP& parm, const funcexp::Func& thisFunc, long timeZone)
ParmTSInt64() = default;
ParmTSInt64(rowgroup::Row& row, const execplan::SPTP& parm, const funcexp::Func&, long)
: TSInt64Null(parm->data()->toTSInt64Null(row))
{
}
@ -232,10 +228,8 @@ class ParmTSInt64 : public datatypes::TSInt64Null
class ParmTUInt64 : public datatypes::TUInt64Null
{
public:
ParmTUInt64()
{
}
ParmTUInt64(rowgroup::Row& row, const execplan::SPTP& parm, const funcexp::Func& thisFunc, long timeZone)
ParmTUInt64() = default;
ParmTUInt64(rowgroup::Row& row, const execplan::SPTP& parm, const funcexp::Func&, long)
: TUInt64Null(parm->data()->toTUInt64Null(row))
{
}

View File

@ -35,15 +35,11 @@ namespace funcexp
class Func_All : public Func
{
public:
Func_All()
{
}
Func_All(const std::string& funcName) : Func(funcName)
{
}
virtual ~Func_All()
Func_All() = default;
explicit Func_All(const std::string& funcName) : Func(funcName)
{
}
~Func_All() override = default;
/*
int64_t getIntVal(rowgroup::Row& row,
@ -71,42 +67,40 @@ class Func_simple_case : public Func_All
Func_simple_case() : Func_All("case_simple")
{
}
virtual ~Func_simple_case()
{
}
~Func_simple_case() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
class Func_decode_oracle : public Func_All
@ -115,42 +109,40 @@ class Func_decode_oracle : public Func_All
Func_decode_oracle() : Func_All("decode_oracle")
{
}
virtual ~Func_decode_oracle()
{
}
~Func_decode_oracle() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_searched_case class
@ -161,42 +153,40 @@ class Func_searched_case : public Func_All
Func_searched_case() : Func_All("case_searched")
{
}
virtual ~Func_searched_case()
{
}
~Func_searched_case() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_if class
@ -207,39 +197,37 @@ class Func_if : public Func_All
Func_if() : Func_All("Func_if")
{
}
virtual ~Func_if()
{
}
~Func_if() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_ifnull class
@ -250,42 +238,40 @@ class Func_ifnull : public Func_All
Func_ifnull() : Func_All("ifnull")
{
}
virtual ~Func_ifnull()
{
}
~Func_ifnull() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_greatest class
@ -296,42 +282,40 @@ class Func_greatest : public Func_All
Func_greatest() : Func_All("greatest")
{
}
virtual ~Func_greatest()
{
}
~Func_greatest() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_least class
@ -342,39 +326,37 @@ class Func_least : public Func_All
Func_least() : Func_All("least")
{
}
virtual ~Func_least()
{
}
~Func_least() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_coalesce class
@ -385,39 +367,37 @@ class Func_coalesce : public Func_All
Func_coalesce() : Func_All("coalesce")
{
}
virtual ~Func_coalesce()
{
}
~Func_coalesce() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_nullif class
@ -428,42 +408,40 @@ class Func_nullif : public Func_All
Func_nullif() : Func_All("nullif")
{
}
virtual ~Func_nullif()
{
}
~Func_nullif() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
} // namespace funcexp

View File

@ -34,15 +34,11 @@ namespace funcexp
class Func_Bool : public Func
{
public:
Func_Bool()
{
}
Func_Bool(const std::string& funcName) : Func(funcName)
{
}
virtual ~Func_Bool()
Func_Bool() = default;
explicit Func_Bool(const std::string& funcName) : Func(funcName)
{
}
~Func_Bool() override = default;
/*
virtual bool getBoolVal(rowgroup::Row& row,
@ -53,58 +49,58 @@ class Func_Bool : public Func
*/
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (getBoolVal(row, fp, isNull, op_ct) ? 1 : 0);
}
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (getBoolVal(row, fp, isNull, op_ct) ? 1.0 : 0.0);
}
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (getBoolVal(row, fp, isNull, op_ct) ? 1.0 : 0.0);
}
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (getBoolVal(row, fp, isNull, op_ct) ? "1" : "0");
}
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return execplan::IDB_Decimal(getIntVal(row, fp, isNull, op_ct), 0, 0);
}
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
isNull = true;
return 0;
}
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
isNull = true;
return 0;
}
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
isNull = true;
return 0;
}
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
isNull = true;
return 0;
@ -119,15 +115,13 @@ class Func_between : public Func_Bool
Func_between() : Func_Bool("between")
{
}
virtual ~Func_between()
{
}
~Func_between() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_notbetween class
@ -138,15 +132,13 @@ class Func_notbetween : public Func_Bool
Func_notbetween() : Func_Bool("notbetween")
{
}
virtual ~Func_notbetween()
{
}
~Func_notbetween() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_in class
@ -157,15 +149,13 @@ class Func_in : public Func_Bool
Func_in() : Func_Bool("in")
{
}
virtual ~Func_in()
{
}
~Func_in() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_notin class
@ -176,15 +166,13 @@ class Func_notin : public Func_Bool
Func_notin() : Func_Bool("notin")
{
}
virtual ~Func_notin()
{
}
~Func_notin() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_regexp class
@ -195,15 +183,13 @@ class Func_regexp : public Func_Bool
Func_regexp() : Func_Bool("regexp")
{
}
virtual ~Func_regexp()
{
}
~Func_regexp() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_isnull class
@ -217,24 +203,22 @@ class Func_isnull : public Func_Bool
Func_isnull() : fIsNotNull(false)
{
}
Func_isnull(bool isnotnull) : fIsNotNull(isnotnull)
explicit Func_isnull(bool isnotnull) : fIsNotNull(isnotnull)
{
}
/*
* Destructor. isnull does not need to do anything here to clean up.
*/
virtual ~Func_isnull()
{
}
~Func_isnull() override = default;
/**
* Decide on the function's operation type
*/
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
private:
bool fIsNotNull;
@ -250,19 +234,17 @@ class Func_Truth : public Func_Bool
{
}
virtual ~Func_Truth()
{
}
~Func_Truth() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType)
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override
{
assert(fp.size() == 1);
return fp[0]->data()->resultType();
}
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
bool val = fp[0]->data()->getBoolVal(row, isNull);
@ -292,9 +274,7 @@ class Func_IsTrue : public Func_Truth
Func_IsTrue() : Func_Truth("istrue", true, true)
{
}
~Func_IsTrue()
{
}
~Func_IsTrue() override = default;
};
/** @brief Func_IsNotTrue class
@ -305,9 +285,7 @@ class Func_IsNotTrue : public Func_Truth
Func_IsNotTrue() : Func_Truth("isnottrue", true, false)
{
}
~Func_IsNotTrue()
{
}
~Func_IsNotTrue() override = default;
};
/** @brief Func_IsFalse class
@ -318,9 +296,7 @@ class Func_IsFalse : public Func_Truth
Func_IsFalse() : Func_Truth("isfalse", false, true)
{
}
~Func_IsFalse()
{
}
~Func_IsFalse() override = default;
};
/** @brief Func_IsNotFalse class
@ -331,9 +307,7 @@ class Func_IsNotFalse : public Func_Truth
Func_IsNotFalse() : Func_Truth("isnotfalse", false, false)
{
}
~Func_IsNotFalse()
{
}
~Func_IsNotFalse() override = default;
};
} // namespace funcexp

View File

@ -36,15 +36,11 @@ namespace funcexp
class Func_Dtm : public Func
{
public:
Func_Dtm()
{
}
Func_Dtm(const std::string& funcName) : Func(funcName)
{
}
virtual ~Func_Dtm()
Func_Dtm() = default;
explicit Func_Dtm(const std::string& funcName) : Func(funcName)
{
}
~Func_Dtm() override = default;
/*
int64_t getIntVal(rowgroup::Row& row,
@ -54,13 +50,13 @@ class Func_Dtm : public Func
*/
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (double)getIntVal(row, fp, isNull, op_ct);
}
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (long double)getIntVal(row, fp, isNull, op_ct);
}
@ -81,18 +77,16 @@ class Func_date : public Func_Dtm
Func_date() : Func_Dtm("date")
{
}
virtual ~Func_date()
{
}
~Func_date() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_time class
@ -103,21 +97,19 @@ class Func_time : public Func_Dtm
Func_time() : Func_Dtm("time")
{
}
virtual ~Func_time()
{
}
~Func_time() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_timediff class
@ -128,30 +120,28 @@ class Func_timediff : public Func_Dtm
Func_timediff() : Func_Dtm("timediff")
{
}
virtual ~Func_timediff()
{
}
~Func_timediff() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_date_add class
@ -162,18 +152,16 @@ class Func_date_add : public Func_Dtm
Func_date_add() : Func_Dtm("date_add")
{
}
virtual ~Func_date_add()
{
}
~Func_date_add() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_date class
@ -184,33 +172,31 @@ class Func_cast_date : public Func_Dtm
Func_cast_date() : Func_Dtm("cast_date")
{
}
virtual ~Func_cast_date()
{
}
~Func_cast_date() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_datetime class
@ -221,33 +207,31 @@ class Func_cast_datetime : public Func_Dtm
Func_cast_datetime() : Func_Dtm("cast_datetime")
{
}
virtual ~Func_cast_datetime()
{
}
~Func_cast_datetime() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_from_days class
@ -258,24 +242,22 @@ class Func_from_days : public Func_Dtm
Func_from_days() : Func_Dtm("from_days")
{
}
virtual ~Func_from_days()
{
}
~Func_from_days() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_add_time class
@ -286,30 +268,28 @@ class Func_add_time : public Func_Dtm
Func_add_time() : Func_Dtm("add_time")
{
}
virtual ~Func_add_time()
{
}
~Func_add_time() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_timestampdiff class
@ -320,30 +300,28 @@ class Func_timestampdiff : public Func_Dtm
Func_timestampdiff() : Func_Dtm("timestamp_diff")
{
}
virtual ~Func_timestampdiff()
{
}
~Func_timestampdiff() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_sysdate class
@ -354,30 +332,28 @@ class Func_sysdate : public Func_Dtm
Func_sysdate() : Func_Dtm("sysdate")
{
}
virtual ~Func_sysdate()
{
}
~Func_sysdate() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_from_unixtime
@ -388,32 +364,30 @@ class Func_from_unixtime : public Func_Dtm
Func_from_unixtime() : Func_Dtm("from_unixtime")
{
}
virtual ~Func_from_unixtime()
{
}
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
~Func_from_unixtime() override = default;
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_str_to_date class
@ -424,30 +398,28 @@ class Func_str_to_date : public Func_Dtm
Func_str_to_date() : Func_Dtm("str_to_date")
{
}
virtual ~Func_str_to_date()
{
}
~Func_str_to_date() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_makedate class
@ -458,18 +430,16 @@ class Func_makedate : public Func_Dtm
Func_makedate() : Func_Dtm("makedate")
{
}
virtual ~Func_makedate()
{
}
~Func_makedate() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
class Func_convert_tz : public Func_Dtm
@ -478,24 +448,22 @@ class Func_convert_tz : public Func_Dtm
Func_convert_tz() : Func_Dtm("convert_tz")
{
}
virtual ~Func_convert_tz()
{
}
~Func_convert_tz() override = default;
// bool from_tz_cached, to_tz_cached;
// Time_zone *from_tz, *to_tz;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
execplan::CalpontSystemCatalog::ColType& ct);
execplan::CalpontSystemCatalog::ColType& ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
} // namespace funcexp

View File

@ -38,31 +38,29 @@ class Func_rand : public Func
Func_rand() : Func("rand"), fSeed1(0), fSeed2(0), fSeedSet(false)
{
}
virtual ~Func_rand()
{
}
~Func_rand() override = default;
double getRand();
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((int64_t)getDoubleVal(row, fp, isNull, op_ct));
}
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (long double)getDoubleVal(row, fp, isNull, op_ct);
}
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return doubleToString(getDoubleVal(row, fp, isNull, op_ct));
}

View File

@ -34,15 +34,11 @@ namespace funcexp
class Func_Int : public Func
{
public:
Func_Int()
{
}
Func_Int(const std::string& funcName) : Func(funcName)
{
}
virtual ~Func_Int()
Func_Int() = default;
explicit Func_Int(const std::string& funcName) : Func(funcName)
{
}
~Func_Int() override = default;
/*
int64_t getIntVal(rowgroup::Row& row,
@ -52,19 +48,19 @@ class Func_Int : public Func
*/
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((double)getIntVal(row, fp, isNull, op_ct));
}
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((long double)getIntVal(row, fp, isNull, op_ct));
}
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return intToString(getIntVal(row, fp, isNull, op_ct));
}
@ -73,7 +69,7 @@ class Func_Int : public Func
class Func_BitOp : public Func_Int
{
public:
Func_BitOp(const std::string& funcName) : Func_Int(funcName)
explicit Func_BitOp(const std::string& funcName) : Func_Int(funcName)
{
}
execplan::CalpontSystemCatalog::ColType operationType(
@ -109,15 +105,13 @@ class Func_instr : public Func_Int
Func_instr() : Func_Int("instr")
{
}
virtual ~Func_instr()
{
}
~Func_instr() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_length class
@ -128,15 +122,13 @@ class Func_length : public Func_Int
Func_length() : Func_Int("length")
{
}
virtual ~Func_length()
{
}
~Func_length() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_sign class
@ -147,18 +139,16 @@ class Func_sign : public Func_Int
Func_sign() : Func_Int("sign")
{
}
virtual ~Func_sign()
{
}
~Func_sign() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_day class
@ -169,15 +159,13 @@ class Func_day : public Func_Int
Func_day() : Func_Int("day")
{
}
virtual ~Func_day()
{
}
~Func_day() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_minute class
@ -188,15 +176,13 @@ class Func_minute : public Func_Int
Func_minute() : Func_Int("minute")
{
}
virtual ~Func_minute()
{
}
~Func_minute() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_month class
@ -207,15 +193,13 @@ class Func_month : public Func_Int
Func_month() : Func_Int("month")
{
}
virtual ~Func_month()
{
}
~Func_month() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_week class
@ -226,15 +210,13 @@ class Func_week : public Func_Int
Func_week() : Func_Int("week")
{
}
virtual ~Func_week()
{
}
~Func_week() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_year class
@ -245,15 +227,13 @@ class Func_year : public Func_Int
Func_year() : Func_Int("year")
{
}
virtual ~Func_year()
{
}
~Func_year() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_to_days class
@ -264,15 +244,13 @@ class Func_to_days : public Func_Int
Func_to_days() : Func_Int("to_days")
{
}
virtual ~Func_to_days()
{
}
~Func_to_days() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_char_length class
@ -283,15 +261,13 @@ class Func_char_length : public Func_Int
Func_char_length() : Func_Int("length")
{
}
virtual ~Func_char_length()
{
}
~Func_char_length() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_extract class
@ -302,15 +278,13 @@ class Func_extract : public Func_Int
Func_extract() : Func_Int("extract")
{
}
virtual ~Func_extract()
{
}
~Func_extract() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_signed class
@ -321,15 +295,13 @@ class Func_cast_signed : public Func_Int
Func_cast_signed() : Func_Int("cast_signed")
{
}
virtual ~Func_cast_signed()
{
}
~Func_cast_signed() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_unsigned class
@ -340,21 +312,19 @@ class Func_cast_unsigned : public Func_Int
Func_cast_unsigned() : Func_Int("cast_unsigned")
{
}
virtual ~Func_cast_unsigned()
{
}
~Func_cast_unsigned() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return (int64_t)(getUintVal(row, fp, isNull, op_ct));
}
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_bitand class
@ -365,9 +335,7 @@ class Func_bitand : public Func_BitOp
Func_bitand() : Func_BitOp("bitand")
{
}
virtual ~Func_bitand()
{
}
~Func_bitand() override = default;
bool fix(execplan::FunctionColumn& col) const override;
};
@ -379,9 +347,7 @@ class Func_bitor : public Func_BitOp
Func_bitor() : Func_BitOp("bitor")
{
}
virtual ~Func_bitor()
{
}
~Func_bitor() override = default;
bool fix(execplan::FunctionColumn& col) const override;
@ -397,9 +363,7 @@ class Func_bitxor : public Func_BitOp
Func_bitxor() : Func_BitOp("bitxor")
{
}
virtual ~Func_bitxor()
{
}
~Func_bitxor() override = default;
bool fix(execplan::FunctionColumn& col) const override;
};
@ -411,9 +375,7 @@ class Func_bit_count : public Func_BitOp
Func_bit_count() : Func_BitOp("bit_count")
{
}
virtual ~Func_bit_count()
{
}
~Func_bit_count() override = default;
bool fix(execplan::FunctionColumn& col) const override;
};
@ -425,15 +387,13 @@ class Func_hour : public Func_Int
Func_hour() : Func_Int("hour")
{
}
virtual ~Func_hour()
{
}
~Func_hour() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_second class
@ -444,15 +404,13 @@ class Func_second : public Func_Int
Func_second() : Func_Int("second")
{
}
virtual ~Func_second()
{
}
~Func_second() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_dayofweek class
@ -463,15 +421,13 @@ class Func_dayofweek : public Func_Int
Func_dayofweek() : Func_Int("dayofweek")
{
}
virtual ~Func_dayofweek()
{
}
~Func_dayofweek() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_dayofyear class
@ -482,15 +438,13 @@ class Func_dayofyear : public Func_Int
Func_dayofyear() : Func_Int("dayofyear")
{
}
virtual ~Func_dayofyear()
{
}
~Func_dayofyear() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_leftshift class
@ -501,9 +455,7 @@ class Func_leftshift : public Func_BitOp
Func_leftshift() : Func_BitOp("leftshift")
{
}
virtual ~Func_leftshift()
{
}
~Func_leftshift() override = default;
bool fix(execplan::FunctionColumn& col) const override;
};
@ -515,9 +467,7 @@ class Func_rightshift : public Func_BitOp
Func_rightshift() : Func_BitOp("rightshift")
{
}
virtual ~Func_rightshift()
{
}
~Func_rightshift() override = default;
bool fix(execplan::FunctionColumn& col) const override;
};
@ -529,15 +479,13 @@ class Func_quarter : public Func_Int
Func_quarter() : Func_Int("quarter")
{
}
virtual ~Func_quarter()
{
}
~Func_quarter() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_ascii class
@ -548,15 +496,13 @@ class Func_ascii : public Func_Int
Func_ascii() : Func_Int("ascii")
{
}
virtual ~Func_ascii()
{
}
~Func_ascii() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_dayname class
@ -567,18 +513,16 @@ class Func_dayname : public Func_Int
Func_dayname() : Func_Int("dayname")
{
}
virtual ~Func_dayname()
{
}
~Func_dayname() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_weekday class
@ -589,15 +533,13 @@ class Func_weekday : public Func_Int
Func_weekday() : Func_Int("weekday")
{
}
virtual ~Func_weekday()
{
}
~Func_weekday() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_yearweek class
@ -608,15 +550,13 @@ class Func_yearweek : public Func_Int
Func_yearweek() : Func_Int("yearweek")
{
}
virtual ~Func_yearweek()
{
}
~Func_yearweek() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_last_day class
@ -627,15 +567,13 @@ class Func_last_day : public Func_Int
Func_last_day() : Func_Int("last_day")
{
}
virtual ~Func_last_day()
{
}
~Func_last_day() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_time_to_sec class
@ -646,15 +584,13 @@ class Func_time_to_sec : public Func_Int
Func_time_to_sec() : Func_Int("time_to_sec")
{
}
virtual ~Func_time_to_sec()
{
}
~Func_time_to_sec() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_microsecond class
@ -665,15 +601,13 @@ class Func_microsecond : public Func_Int
Func_microsecond() : Func_Int("microsecond")
{
}
virtual ~Func_microsecond()
{
}
~Func_microsecond() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_crc32 class
@ -684,15 +618,13 @@ class Func_crc32 : public Func_Int
Func_crc32() : Func_Int("crc32")
{
}
virtual ~Func_crc32()
{
}
~Func_crc32() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_period_add class
@ -703,15 +635,13 @@ class Func_period_add : public Func_Int
Func_period_add() : Func_Int("period_add")
{
}
virtual ~Func_period_add()
{
}
~Func_period_add() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_period_diff class
@ -722,15 +652,13 @@ class Func_period_diff : public Func_Int
Func_period_diff() : Func_Int("period_diff")
{
}
virtual ~Func_period_diff()
{
}
~Func_period_diff() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_strcmp class
@ -741,18 +669,16 @@ class Func_strcmp : public Func_Int
Func_strcmp() : Func_Int("strcmp")
{
}
virtual ~Func_strcmp()
{
}
~Func_strcmp() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_unix_timestamp class
@ -763,18 +689,16 @@ class Func_unix_timestamp : public Func_Int
Func_unix_timestamp() : Func_Int("unix_timestamp")
{
}
virtual ~Func_unix_timestamp()
{
}
~Func_unix_timestamp() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_strcmp class
@ -785,22 +709,20 @@ class Func_find_in_set : public Func_Int
Func_find_in_set() : Func_Int("find_in_set")
{
}
virtual ~Func_find_in_set()
{
}
~Func_find_in_set() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
} // namespace funcexp

View File

@ -28,7 +28,7 @@ struct JSONPath
JSONPath() : constant(false), parsed(false), currStep(nullptr)
{
}
json_path_t p;
json_path_t p{};
bool constant; // check if the argument is constant
bool parsed; // check if the argument is parsed
json_path_step_t* currStep;
@ -52,10 +52,9 @@ class JSONEgWrapper : public json_engine_t
class JSONPathWrapper : public JSONPath
{
protected:
virtual ~JSONPathWrapper()
{
}
virtual ~JSONPathWrapper() = default;
virtual bool checkAndGetValue(JSONEgWrapper* je, std::string& ret, int* error) = 0;
public:
bool extract(std::string& ret, rowgroup::Row& row, execplan::SPTP& funcParmJS,
execplan::SPTP& funcParmPath);
@ -68,15 +67,13 @@ class Func_json_valid : public Func_Bool
Func_json_valid() : Func_Bool("json_valid")
{
}
~Func_json_valid()
{
}
~Func_json_valid() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_depth class
@ -87,15 +84,13 @@ class Func_json_depth : public Func_Int
Func_json_depth() : Func_Int("json_depth")
{
}
virtual ~Func_json_depth()
{
}
~Func_json_depth() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_length class
@ -109,15 +104,13 @@ class Func_json_length : public Func_Int
Func_json_length() : Func_Int("json_length")
{
}
virtual ~Func_json_length()
{
}
~Func_json_length() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_equals class
@ -128,15 +121,13 @@ class Func_json_equals : public Func_Bool
Func_json_equals() : Func_Bool("json_equals")
{
}
~Func_json_equals()
{
}
~Func_json_equals() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_normalize class
@ -147,15 +138,13 @@ class Func_json_normalize : public Func_Str
Func_json_normalize() : Func_Str("json_normalize")
{
}
virtual ~Func_json_normalize()
{
}
~Func_json_normalize() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_type class
@ -166,15 +155,13 @@ class Func_json_type : public Func_Str
Func_json_type() : Func_Str("json_type")
{
}
virtual ~Func_json_type()
{
}
~Func_json_type() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_object class
@ -185,15 +172,13 @@ class Func_json_object : public Func_Str
Func_json_object() : Func_Str("json_object")
{
}
virtual ~Func_json_object()
{
}
~Func_json_object() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_array class
@ -204,15 +189,13 @@ class Func_json_array : public Func_Str
Func_json_array() : Func_Str("json_array")
{
}
virtual ~Func_json_array()
{
}
~Func_json_array() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_keys class
*/
@ -225,15 +208,13 @@ class Func_json_keys : public Func_Str
Func_json_keys() : Func_Str("json_keys")
{
}
virtual ~Func_json_keys()
{
}
~Func_json_keys() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_exists class
*/
@ -246,15 +227,13 @@ class Func_json_exists : public Func_Bool
Func_json_exists() : Func_Bool("json_exists")
{
}
~Func_json_exists()
{
}
~Func_json_exists() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_quote class
@ -268,15 +247,13 @@ class Func_json_quote : public Func_Str
Func_json_quote() : Func_Str("json_quote")
{
}
virtual ~Func_json_quote()
{
}
~Func_json_quote() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_unquote class
@ -290,15 +267,13 @@ class Func_json_unquote : public Func_Str
Func_json_unquote() : Func_Str("json_unquote")
{
}
virtual ~Func_json_unquote()
{
}
~Func_json_unquote() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_format class
@ -321,7 +296,7 @@ class Func_json_format : public Func_Str
Func_json_format() : Func_Str("json_detailed"), fmt(DETAILED)
{
}
Func_json_format(FORMATS format) : fmt(format)
explicit Func_json_format(FORMATS format) : fmt(format)
{
assert(format != NONE);
switch (format)
@ -332,15 +307,13 @@ class Func_json_format : public Func_Str
default: break;
}
}
virtual ~Func_json_format()
{
}
~Func_json_format() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_merge_preserve class
*/
@ -350,15 +323,13 @@ class Func_json_merge : public Func_Str
Func_json_merge() : Func_Str("json_merge_preserve")
{
}
virtual ~Func_json_merge()
{
}
~Func_json_merge() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_merge_patch class
@ -369,15 +340,13 @@ class Func_json_merge_patch : public Func_Str
Func_json_merge_patch() : Func_Str("json_merge_patch")
{
}
virtual ~Func_json_merge_patch()
{
}
~Func_json_merge_patch() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_value class
@ -388,9 +357,7 @@ class Func_json_value : public Func_Str
Func_json_value() : Func_Str("json_value")
{
}
virtual ~Func_json_value()
{
}
~Func_json_value() override = default;
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
@ -407,9 +374,7 @@ class Func_json_query : public Func_Str
Func_json_query() : Func_Str("json_query")
{
}
virtual ~Func_json_query()
{
}
~Func_json_query() override = default;
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
@ -431,15 +396,13 @@ class Func_json_contains : public Func_Bool
Func_json_contains() : Func_Bool("json_contains"), arg2Const(false), arg2Parsed(false), arg2Val("")
{
}
virtual ~Func_json_contains()
{
}
~Func_json_contains() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_array_append class
*/
@ -452,15 +415,13 @@ class Func_json_array_append : public Func_Str
Func_json_array_append() : Func_Str("json_array_append")
{
}
virtual ~Func_json_array_append()
{
}
~Func_json_array_append() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
private:
static const int padding = 8;
@ -476,15 +437,13 @@ class Func_json_array_insert : public Func_Str
Func_json_array_insert() : Func_Str("json_array_insert")
{
}
virtual ~Func_json_array_insert()
{
}
~Func_json_array_insert() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_insert class
@ -508,7 +467,7 @@ class Func_json_insert : public Func_Str
Func_json_insert() : Func_Str("json_insert"), mode(INSERT)
{
}
Func_json_insert(MODE m) : mode(m)
explicit Func_json_insert(MODE m) : mode(m)
{
assert(m != NONE);
switch (m)
@ -519,20 +478,18 @@ class Func_json_insert : public Func_Str
default: break;
}
}
virtual ~Func_json_insert()
{
}
~Func_json_insert() override = default;
MODE getMode() const
{
return mode;
}
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_remove class
*/
@ -545,15 +502,13 @@ class Func_json_remove : public Func_Str
Func_json_remove() : Func_Str("json_remove")
{
}
virtual ~Func_json_remove()
{
}
~Func_json_remove() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_contains_path class
@ -572,15 +527,13 @@ class Func_json_contains_path : public Func_Bool
: Func_Bool("json_contains_path"), isModeOne(false), isModeConst(false), isModeParsed(false)
{
}
virtual ~Func_json_contains_path()
{
}
~Func_json_contains_path() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_overlaps class
@ -594,15 +547,13 @@ class Func_json_overlaps : public Func_Bool
Func_json_overlaps() : Func_Bool("json_overlaps")
{
}
virtual ~Func_json_overlaps()
{
}
~Func_json_overlaps() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
};
/** @brief Func_json_search class
*/
@ -620,15 +571,13 @@ class Func_json_search : public Func_Str
: Func_Str("json_search"), isModeParsed(false), isModeConst(false), isModeOne(false), escape('\\')
{
}
virtual ~Func_json_search()
{
}
~Func_json_search() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
private:
int cmpJSValWild(json_engine_t* jsEg, const utils::NullString& cmpStr, const CHARSET_INFO* cs);
@ -644,24 +593,22 @@ class Func_json_extract : public Func_Str
Func_json_extract() : Func_Str("json_extract")
{
}
virtual ~Func_json_extract()
{
}
~Func_json_extract() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& type);
execplan::CalpontSystemCatalog::ColType& type) override;
private:
int doExtract(rowgroup::Row& row, FunctionParm& fp, json_value_types* type, std::string& retJS,

View File

@ -35,36 +35,32 @@ namespace funcexp
class Func_Real : public Func
{
public:
Func_Real()
{
}
Func_Real(const std::string& funcName) : Func(funcName)
{
}
virtual ~Func_Real()
Func_Real() = default;
explicit Func_Real(const std::string& funcName) : Func(funcName)
{
}
~Func_Real() override = default;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((int64_t)getDoubleVal(row, fp, isNull, op_ct));
}
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((uint64_t)getDoubleVal(row, fp, isNull, op_ct));
}
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return ((long double)getDoubleVal(row, fp, isNull, op_ct));
}
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
execplan::CalpontSystemCatalog::ColType& op_ct) override
{
return doubleToString(getDoubleVal(row, fp, isNull, op_ct));
}
@ -78,27 +74,25 @@ class Func_abs : public Func_Real
Func_abs() : Func_Real("abs")
{
}
virtual ~Func_abs()
{
}
~Func_abs() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_exp class
@ -109,18 +103,16 @@ class Func_exp : public Func_Real
Func_exp() : Func_Real("exp")
{
}
virtual ~Func_exp()
{
}
~Func_exp() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_pow class
@ -131,18 +123,16 @@ class Func_pow : public Func_Real
Func_pow() : Func_Real("pow")
{
}
virtual ~Func_pow()
{
}
~Func_pow() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_round class
@ -153,39 +143,37 @@ class Func_round : public Func_Real
Func_round() : Func_Real("round")
{
}
virtual ~Func_round()
{
}
~Func_round() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_truncate class
@ -196,39 +184,37 @@ class Func_truncate : public Func_Real
Func_truncate() : Func_Real("truncate")
{
}
virtual ~Func_truncate()
{
}
~Func_truncate() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_ceil class
@ -239,30 +225,28 @@ class Func_ceil : public Func_Real
Func_ceil() : Func_Real("ceil")
{
}
virtual ~Func_ceil()
{
}
~Func_ceil() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_floor class
@ -273,30 +257,28 @@ class Func_floor : public Func_Real
Func_floor() : Func_Real("floor")
{
}
virtual ~Func_floor()
{
}
~Func_floor() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_decimal class
@ -307,24 +289,22 @@ class Func_cast_decimal : public Func_Real
Func_cast_decimal() : Func_Real("cast_decimal")
{
}
virtual ~Func_cast_decimal()
{
}
~Func_cast_decimal() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cast_double class
@ -335,21 +315,19 @@ class Func_cast_double : public Func_Real
Func_cast_double() : Func_Real("cast_double")
{
}
virtual ~Func_cast_double()
{
}
~Func_cast_double() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_mod class
@ -360,30 +338,28 @@ class Func_mod : public Func_Real
Func_mod() : Func_Real("mod")
{
}
virtual ~Func_mod()
{
}
~Func_mod() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
long double getLongDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
execplan::CalpontSystemCatalog::ColType& operationColType);
execplan::CalpontSystemCatalog::ColType& operationColType) override;
uint64_t getUIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
execplan::CalpontSystemCatalog::ColType& operationColType);
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
execplan::CalpontSystemCatalog::ColType& operationColType) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
private:
template <typename ModType>
@ -418,15 +394,13 @@ class Func_acos : public Func_Real
Func_acos() : Func_Real("acos")
{
}
virtual ~Func_acos()
{
}
~Func_acos() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_asin class
@ -437,15 +411,13 @@ class Func_asin : public Func_Real
Func_asin() : Func_Real("asin")
{
}
virtual ~Func_asin()
{
}
~Func_asin() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_atan class
@ -456,15 +428,13 @@ class Func_atan : public Func_Real
Func_atan() : Func_Real("atan")
{
}
virtual ~Func_atan()
{
}
~Func_atan() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cos class
@ -475,15 +445,13 @@ class Func_cos : public Func_Real
Func_cos() : Func_Real("cos")
{
}
virtual ~Func_cos()
{
}
~Func_cos() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_cot class
@ -494,15 +462,13 @@ class Func_cot : public Func_Real
Func_cot() : Func_Real("cot")
{
}
virtual ~Func_cot()
{
}
~Func_cot() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_log class
@ -513,15 +479,13 @@ class Func_log : public Func_Real
Func_log() : Func_Real("log")
{
}
virtual ~Func_log()
{
}
~Func_log() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_log2 class
@ -532,15 +496,13 @@ class Func_log2 : public Func_Real
Func_log2() : Func_Real("log2")
{
}
virtual ~Func_log2()
{
}
~Func_log2() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_log10 class
@ -551,15 +513,13 @@ class Func_log10 : public Func_Real
Func_log10() : Func_Real("log10")
{
}
virtual ~Func_log10()
{
}
~Func_log10() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_sin class
@ -570,15 +530,13 @@ class Func_sin : public Func_Real
Func_sin() : Func_Real("sin")
{
}
virtual ~Func_sin()
{
}
~Func_sin() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_sqrt class
@ -589,15 +547,13 @@ class Func_sqrt : public Func_Real
Func_sqrt() : Func_Real("sqrt")
{
}
virtual ~Func_sqrt()
{
}
~Func_sqrt() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_tan class
@ -608,15 +564,13 @@ class Func_tan : public Func_Real
Func_tan() : Func_Real("tan")
{
}
virtual ~Func_tan()
{
}
~Func_tan() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_radians class
@ -627,15 +581,13 @@ class Func_radians : public Func_Real
Func_radians() : Func_Real("radians")
{
}
virtual ~Func_radians()
{
}
~Func_radians() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_div class
@ -646,24 +598,22 @@ class Func_div : public Func_Real
Func_div() : Func_Real("DIV")
{
}
virtual ~Func_div()
{
}
~Func_div() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
uint64_t getUintVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
/** @brief Func_inet_aton class to convert ascii IP address to big-endian
@ -675,39 +625,37 @@ class Func_inet_aton : public Func_Real
Func_inet_aton() : Func_Real("inet_aton")
{
}
virtual ~Func_inet_aton()
{
}
~Func_inet_aton() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
int64_t getIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
std::string getStrVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
bool getBoolVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
execplan::IDB_Decimal getDecimalVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int32_t getDateIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getDatetimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimestampIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
int64_t getTimeIntVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
private:
int64_t convertAton(const std::string& ipString, bool& isNull);
@ -721,15 +669,13 @@ class Func_degrees : public Func_Real
Func_degrees() : Func_Real("degrees")
{
}
virtual ~Func_degrees()
{
}
~Func_degrees() override = default;
execplan::CalpontSystemCatalog::ColType operationType(FunctionParm& fp,
execplan::CalpontSystemCatalog::ColType& resultType);
execplan::CalpontSystemCatalog::ColType operationType(
FunctionParm& fp, execplan::CalpontSystemCatalog::ColType& resultType) override;
double getDoubleVal(rowgroup::Row& row, FunctionParm& fp, bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct);
execplan::CalpontSystemCatalog::ColType& op_ct) override;
};
} // namespace funcexp
} // namespace funcexp

File diff suppressed because it is too large Load Diff

View File

@ -8,7 +8,7 @@
#include <mariadb.h>
#include <mysql.h>
#include <my_sys.h>
//#include <json_lib.h>
// #include <json_lib.h>
#include "collation.h"
#include "functor_json.h"
@ -21,9 +21,7 @@
#include "json_lib.h"
namespace funcexp
{
namespace helpers
namespace funcexp::helpers
{
static const int NO_WILDCARD_ALLOWED = 1;
@ -35,7 +33,8 @@ static const int NO_WILDCARD_ALLOWED = 1;
int setupJSPath(json_path_t* path, CHARSET_INFO* cs, const string_view& str, bool wildcards);
// Return true if err occur, let the outer function handle the exception
bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullString& js, const CHARSET_INFO* jsCS);
bool appendEscapedJS(string& ret, const CHARSET_INFO* retCS, const utils::NullString& js,
const CHARSET_INFO* jsCS);
bool appendJSKeyName(string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
bool appendJSValue(string& ret, const CHARSET_INFO* retCS, rowgroup::Row& row, execplan::SPTP& parm);
@ -97,12 +96,11 @@ int parseJSPath(JSONPath& path, rowgroup::Row& row, execplan::SPTP& parm, bool w
inline void initJSPaths(vector<JSONPath>& paths, FunctionParm& fp, const int start, const int step)
{
if (paths.size() == 0)
if (paths.empty())
for (size_t i = start; i < fp.size(); i += step)
paths.push_back(JSONPath{});
paths.emplace_back();
}
bool matchJSPath(const vector<funcexp::JSONPath>& paths, const json_path_t* p, json_value_types valType,
const int* arrayCounter = nullptr, bool exact = true);
} // namespace helpers
} // namespace funcexp
} // namespace funcexp::helpers

View File

@ -1,6 +1,6 @@
#pragma once
//#include "my_global.h"
// #include "my_global.h"
/* Macros to make switching between C and C++ mode easier */
#ifdef __cplusplus
#define C_MODE_START \
@ -22,16 +22,12 @@ class SQL_CRYPT
uint shift;
public:
SQL_CRYPT()
{
}
SQL_CRYPT(ulong* seed)
SQL_CRYPT() = default;
explicit SQL_CRYPT(ulong* seed)
{
init(seed);
}
~SQL_CRYPT()
{
}
~SQL_CRYPT() = default;
void init(ulong* seed);
void reinit()
{

View File

@ -32,7 +32,6 @@ class TimeExtractor
public:
TimeExtractor() : dayOfWeek(-1), dayOfYear(-1), weekOfYear(-1), sundayFirst(false)
{
;
}
/**

View File

@ -42,10 +42,10 @@ class invalid_code_point : public exception
uint32_t cp;
public:
invalid_code_point(uint32_t cp) : cp(cp)
explicit invalid_code_point(uint32_t cp) : cp(cp)
{
}
virtual const char* what() const throw()
const char* what() const noexcept override
{
return "Invalid code point";
}
@ -60,10 +60,10 @@ class invalid_utf8 : public exception
uint8_t u8;
public:
invalid_utf8(uint8_t u) : u8(u)
explicit invalid_utf8(uint8_t u) : u8(u)
{
}
virtual const char* what() const throw()
const char* what() const noexcept override
{
return "Invalid UTF-8";
}
@ -78,10 +78,10 @@ class invalid_utf16 : public exception
uint16_t u16;
public:
invalid_utf16(uint16_t u) : u16(u)
explicit invalid_utf16(uint16_t u) : u16(u)
{
}
virtual const char* what() const throw()
const char* what() const noexcept override
{
return "Invalid UTF-16";
}
@ -94,7 +94,7 @@ class invalid_utf16 : public exception
class not_enough_room : public exception
{
public:
virtual const char* what() const throw()
const char* what() const noexcept override
{
return "Not enough space";
}
@ -336,9 +336,7 @@ class iterator : public std::iterator<std::bidirectional_iterator_tag, uint32_t>
octet_iterator range_end;
public:
iterator()
{
}
iterator() = default;
explicit iterator(const octet_iterator& octet_it, const octet_iterator& range_start,
const octet_iterator& range_end)
: it(octet_it), range_start(range_start), range_end(range_end)

View File

@ -28,9 +28,7 @@ DEALINGS IN THE SOFTWARE.
#include "core.h"
namespace utf8
{
namespace unchecked
namespace utf8::unchecked
{
template <typename octet_iterator>
octet_iterator append(uint32_t cp, octet_iterator result)
@ -201,9 +199,7 @@ class iterator : public std::iterator<std::bidirectional_iterator_tag, uint32_t>
octet_iterator it;
public:
iterator()
{
}
iterator() = default;
explicit iterator(const octet_iterator& octet_it) : it(octet_it)
{
}
@ -249,5 +245,4 @@ class iterator : public std::iterator<std::bidirectional_iterator_tag, uint32_t>
}
}; // class iterator
} // namespace unchecked
} // namespace utf8
} // namespace utf8::unchecked