You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
MCOL-4174 Review/refactor frontend/connector code
This commit is contained in:
committed by
Roman Nozdrin
parent
68244ab957
commit
129d5b5a0f
@ -1,6 +1,6 @@
|
||||
include_directories(${ENGINE_COMMON_INCLUDES} ${ENGINE_SRC_DIR}/storage-manager/include)
|
||||
|
||||
set(cloudio_LIB_SRCS SMComm.cpp SMDataFile.cpp SMFileFactory.cpp SMFileSystem.cpp SocketPool.cpp cloud_plugin.cpp)
|
||||
set(cloudio_LIB_SRCS SMComm.cpp SMDataFile.cpp SMFileFactory.cpp SMFileSystem.cpp SocketPool.cpp cloud_plugin.cpp ../../datatypes/mcs_datatype.cpp)
|
||||
|
||||
add_library(cloudio SHARED ${cloudio_LIB_SRCS})
|
||||
|
||||
|
@ -15,7 +15,6 @@
|
||||
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
#include "widedecimalutils.h"
|
||||
#include "emptyvaluemanip.h"
|
||||
|
||||
namespace utils
|
||||
@ -81,7 +80,7 @@ void getEmptyRowValue(const execplan::CalpontSystemCatalog::ColDataType colDataT
|
||||
else if (width <= 8)
|
||||
*(uint64_t*)emptyVal = joblist::BIGINTEMPTYROW;
|
||||
else
|
||||
setWideDecimalEmptyValue(*(reinterpret_cast<int128_t*>(emptyVal)));
|
||||
datatypes::Decimal::setWideDecimalEmptyValue(*(reinterpret_cast<int128_t*>(emptyVal)));
|
||||
break;
|
||||
|
||||
//case CalpontSystemCatalog::BINARY:
|
||||
|
@ -29,52 +29,10 @@ namespace utils
|
||||
const uint64_t BINARYNULLVALUEHIGH = 0x8000000000000000ULL;
|
||||
const uint64_t BINARYEMPTYVALUELOW = 1ULL;
|
||||
const uint64_t BINARYEMPTYVALUEHIGH = 0x8000000000000000ULL;
|
||||
const uint8_t MAXLENGTH16BYTES = 42;
|
||||
const uint8_t MAXLENGTH8BYTES = 23;
|
||||
|
||||
const int128_t minInt128 = int128_t(0x8000000000000000LL) << 64;
|
||||
const int128_t maxInt128 = (int128_t(0x7FFFFFFFFFFFFFFFLL) << 64) + 0xFFFFFFFFFFFFFFFFLL;
|
||||
|
||||
inline bool isWideDecimalNullValue(const int128_t& val)
|
||||
{
|
||||
const uint64_t* ptr = reinterpret_cast<const uint64_t*>(&val);
|
||||
return (ptr[0] == BINARYNULLVALUELOW && ptr[1] == BINARYNULLVALUEHIGH);
|
||||
}
|
||||
|
||||
inline bool isWideDecimalEmptyValue(const int128_t& val)
|
||||
{
|
||||
const uint64_t* ptr = reinterpret_cast<const uint64_t*>(&val);
|
||||
return (ptr[0] == BINARYEMPTYVALUELOW && ptr[1] == BINARYEMPTYVALUEHIGH);
|
||||
}
|
||||
|
||||
inline void setWideDecimalNullValue(int128_t& val)
|
||||
{
|
||||
uint64_t* ptr = reinterpret_cast<uint64_t*>(&val);
|
||||
ptr[0] = BINARYNULLVALUELOW;
|
||||
ptr[1] = BINARYNULLVALUEHIGH;
|
||||
}
|
||||
|
||||
inline void setWideDecimalEmptyValue(int128_t& val)
|
||||
{
|
||||
uint64_t* ptr = reinterpret_cast<uint64_t*>(&val);
|
||||
ptr[0] = BINARYEMPTYVALUELOW;
|
||||
ptr[1] = BINARYEMPTYVALUEHIGH;
|
||||
}
|
||||
|
||||
inline void setWideDecimalNullValue(int128_t* val)
|
||||
{
|
||||
uint64_t* ptr = reinterpret_cast<uint64_t*>(val);
|
||||
ptr[0] = BINARYNULLVALUELOW;
|
||||
ptr[1] = BINARYNULLVALUEHIGH;
|
||||
}
|
||||
|
||||
inline void setWideDecimalEmptyValue(int128_t* val)
|
||||
{
|
||||
uint64_t* ptr = reinterpret_cast<uint64_t*>(val);
|
||||
ptr[0] = BINARYEMPTYVALUELOW;
|
||||
ptr[1] = BINARYEMPTYVALUEHIGH;
|
||||
}
|
||||
|
||||
inline void int128Max(int128_t& val)
|
||||
{
|
||||
uint64_t* ptr = reinterpret_cast<uint64_t*>(&val);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -47,12 +47,11 @@
|
||||
#include <boost/regex.hpp>
|
||||
#endif
|
||||
|
||||
#include "calpontsystemcatalog.h"
|
||||
#include "mcs_datatype.h"
|
||||
#include "columnresult.h"
|
||||
#include "exceptclasses.h"
|
||||
#include "common/branchpred.h"
|
||||
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
// remove this block if the htonll is defined in library
|
||||
#ifdef __linux__
|
||||
@ -87,7 +86,7 @@ inline uint64_t uint64ToStr(uint64_t n)
|
||||
return htonll(n);
|
||||
}
|
||||
|
||||
using cscDataType = execplan::CalpontSystemCatalog::ColDataType;
|
||||
using cscDataType = datatypes::SystemCatalog::ColDataType;
|
||||
|
||||
#if defined(_MSC_VER) && defined(xxxDATACONVERT_DLLEXPORT)
|
||||
#define EXPORT __declspec(dllexport)
|
||||
@ -883,7 +882,8 @@ uint64_t string_to_ull( const std::string& data, bool& bSaturate )
|
||||
|
||||
template <typename T>
|
||||
void number_int_value(const std::string& data,
|
||||
const execplan::CalpontSystemCatalog::ColType& ct,
|
||||
cscDataType typeCode,
|
||||
const datatypes::SystemCatalog::TypeAttributesStd &ct,
|
||||
bool& pushwarning,
|
||||
bool noRoundup,
|
||||
T& intVal);
|
||||
@ -901,7 +901,9 @@ public:
|
||||
* @param type the columns data type
|
||||
* @param data the columns string representation of it's data
|
||||
*/
|
||||
EXPORT static boost::any convertColumnData( const execplan::CalpontSystemCatalog::ColType& colType,
|
||||
EXPORT static boost::any convertColumnData(
|
||||
cscDataType typecode,
|
||||
const datatypes::SystemCatalog::TypeAttributesStd& attr,
|
||||
const std::string& dataOrig, bool& bSaturate, const std::string& timeZone,
|
||||
bool nulFlag = false, bool noRoundup = false, bool isUpdate = false);
|
||||
|
||||
@ -1046,7 +1048,6 @@ public:
|
||||
EXPORT static bool isColumnTimeValid( int64_t time );
|
||||
EXPORT static bool isColumnTimeStampValid( int64_t timeStamp );
|
||||
|
||||
EXPORT static bool isNullData(execplan::ColumnResult* cr, int rownum, execplan::CalpontSystemCatalog::ColType colType);
|
||||
static inline std::string decimalToString(int64_t value, uint8_t scale, cscDataType colDataType);
|
||||
static inline void decimalToString(int64_t value, uint8_t scale, char* buf, unsigned int buflen, cscDataType colDataType);
|
||||
|
||||
@ -1083,7 +1084,8 @@ public:
|
||||
EXPORT static int64_t timeToInt(const std::string& time);
|
||||
EXPORT static int64_t stringToTime (const std::string& data);
|
||||
// bug4388, union type conversion
|
||||
EXPORT static execplan::CalpontSystemCatalog::ColType convertUnionColType(std::vector<execplan::CalpontSystemCatalog::ColType>&);
|
||||
EXPORT static void joinColTypeForUnion(datatypes::SystemCatalog::TypeHolderStd &unionedType,
|
||||
const datatypes::SystemCatalog::TypeHolderStd &type);
|
||||
};
|
||||
|
||||
inline void DataConvert::dateToString( int datevalue, char* buf, unsigned int buflen)
|
||||
|
@ -116,7 +116,7 @@ int64_t Func_round::getIntVal(Row& row,
|
||||
{
|
||||
IDB_Decimal x = getDecimalVal(row, parm, isNull, op_ct);
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
{
|
||||
if (x.scale > 0)
|
||||
{
|
||||
@ -207,7 +207,7 @@ double Func_round::getDoubleVal(Row& row,
|
||||
|
||||
double d;
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
d = x.value;
|
||||
else
|
||||
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
|
||||
@ -274,7 +274,7 @@ long double Func_round::getLongDoubleVal(Row& row,
|
||||
|
||||
double d;
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
d = x.value;
|
||||
else
|
||||
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
|
||||
@ -313,7 +313,7 @@ IDB_Decimal Func_round::getDecimalVal(Row& row,
|
||||
int64_t d = 0;
|
||||
decimal = parm[0]->data()->getDecimalVal(row, isNull);
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
{
|
||||
//@Bug 3101 - GCC 4.5.1 optimizes too aggressively here. Mark as volatile.
|
||||
volatile int64_t p = 1;
|
||||
@ -720,12 +720,12 @@ string Func_round::getStrVal(Row& row,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
return dataconvert::DataConvert::decimalToString(x.value, x.scale, op_ct.colDataType);
|
||||
else
|
||||
{
|
||||
char buf[utils::MAXLENGTH16BYTES];
|
||||
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, utils::MAXLENGTH16BYTES, op_ct.colDataType);
|
||||
char buf[datatypes::Decimal::MAXLENGTH16BYTES];
|
||||
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, (uint8_t) sizeof(buf), op_ct.colDataType);
|
||||
return string(buf);
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ int64_t Func_truncate::getIntVal(Row& row,
|
||||
{
|
||||
IDB_Decimal x = getDecimalVal(row, parm, isNull, op_ct);
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
{
|
||||
if (x.scale > 0)
|
||||
{
|
||||
@ -230,7 +230,7 @@ double Func_truncate::getDoubleVal(Row& row,
|
||||
|
||||
double d;
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
d = x.value;
|
||||
else
|
||||
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
|
||||
@ -290,7 +290,7 @@ long double Func_truncate::getLongDoubleVal(Row& row,
|
||||
|
||||
double d;
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
d = x.value;
|
||||
else
|
||||
d = datatypes::Decimal::getDoubleFromWideDecimal(x.s128Value);
|
||||
@ -334,7 +334,7 @@ IDB_Decimal Func_truncate::getDecimalVal(Row& row,
|
||||
int64_t d = 0;
|
||||
decimal = parm[0]->data()->getDecimalVal(row, isNull);
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
{
|
||||
//@Bug 3101 - GCC 4.5.1 optimizes too aggressively here. Mark as volatile.
|
||||
volatile int64_t p = 1;
|
||||
@ -739,12 +739,12 @@ string Func_truncate::getStrVal(Row& row,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!datatypes::Decimal::isWideDecimalType(op_ct))
|
||||
if (!op_ct.isWideDecimalType())
|
||||
return dataconvert::DataConvert::decimalToString(x.value, x.scale, op_ct.colDataType);
|
||||
else
|
||||
{
|
||||
char buf[utils::MAXLENGTH16BYTES];
|
||||
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, utils::MAXLENGTH16BYTES, op_ct.colDataType);
|
||||
char buf[datatypes::Decimal::MAXLENGTH16BYTES];
|
||||
dataconvert::DataConvert::decimalToString( &x.s128Value, x.scale, buf, (uint8_t) sizeof(buf), op_ct.colDataType);
|
||||
return string(buf);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include "spinlock.h"
|
||||
#include "vlarray.h"
|
||||
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
using namespace std;
|
||||
using namespace rowgroup;
|
||||
@ -110,7 +109,7 @@ TupleJoiner::TupleJoiner(
|
||||
|
||||
if (smallRG.isUnsigned(smallKeyColumns[0]))
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[0]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[0])))
|
||||
{
|
||||
@ -125,7 +124,7 @@ TupleJoiner::TupleJoiner(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[0]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[0])))
|
||||
{
|
||||
@ -225,7 +224,7 @@ TupleJoiner::TupleJoiner(
|
||||
discreteValues[i] = false;
|
||||
if (isUnsigned(smallRG.getColTypes()[smallKeyColumns[i]]))
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[i]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[i])))
|
||||
{
|
||||
@ -240,7 +239,7 @@ TupleJoiner::TupleJoiner(
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[i]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[i])))
|
||||
{
|
||||
@ -802,7 +801,7 @@ void TupleJoiner::doneInserting()
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (datatypes::Decimal::isWideDecimalType(
|
||||
else if (datatypes::isWideDecimalType(
|
||||
smallRow.getColType(smallKeyColumns[col]),
|
||||
smallRow.getColumnWidth(smallKeyColumns[col])))
|
||||
{
|
||||
@ -1165,7 +1164,7 @@ void TupleJoiner::updateCPData(const Row& r)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (datatypes::Decimal::isWideDecimalType(
|
||||
else if (datatypes::isWideDecimalType(
|
||||
r.getColType(colIdx),
|
||||
r.getColumnWidth(colIdx)))
|
||||
{
|
||||
@ -1205,7 +1204,7 @@ void TupleJoiner::updateCPData(const Row& r)
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (datatypes::Decimal::isWideDecimalType(
|
||||
else if (datatypes::isWideDecimalType(
|
||||
r.getColType(colIdx),
|
||||
r.getColumnWidth(colIdx)))
|
||||
{
|
||||
@ -1745,7 +1744,7 @@ boost::shared_ptr<TupleJoiner> TupleJoiner::copyForDiskJoin()
|
||||
ret->discreteValues[i] = false;
|
||||
if (isUnsigned(smallRG.getColTypes()[smallKeyColumns[i]]))
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[i]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[i])))
|
||||
{
|
||||
@ -1760,7 +1759,7 @@ boost::shared_ptr<TupleJoiner> TupleJoiner::copyForDiskJoin()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (datatypes::Decimal::isWideDecimalType(
|
||||
if (datatypes::isWideDecimalType(
|
||||
smallRG.getColType(smallKeyColumns[i]),
|
||||
smallRG.getColumnWidth(smallKeyColumns[i])))
|
||||
{
|
||||
|
@ -158,7 +158,7 @@ mcsv1_UDAF::ReturnCode moda::init(mcsv1Context* context,
|
||||
return mcsv1_UDAF::ERROR;
|
||||
}
|
||||
|
||||
if (!(execplan::isNumeric(colTypes[0].dataType)))
|
||||
if (!(datatypes::isNumeric(colTypes[0].dataType)))
|
||||
{
|
||||
// The error message will be prepended with
|
||||
// "The storage engine for the table doesn't support "
|
||||
|
@ -53,7 +53,6 @@
|
||||
#include "vlarray.h"
|
||||
|
||||
#include "collation.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
//..comment out NDEBUG to enable assertions, uncomment NDEBUG to disable
|
||||
//#define NDEBUG
|
||||
@ -2752,7 +2751,7 @@ void RowAggregationUM::calculateAvgColumns()
|
||||
|
||||
uint32_t precision = fRow.getPrecision(colOut);
|
||||
bool isWideDecimal =
|
||||
datatypes::Decimal::isWideDecimalType(precision);
|
||||
datatypes::Decimal::isWideDecimalTypeByPrecision(precision);
|
||||
|
||||
if (LIKELY(!isWideDecimal))
|
||||
{
|
||||
@ -3687,12 +3686,12 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
|
||||
auto width = fRow.getColumnWidth(colOut);
|
||||
if (width == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
ColTypeAlias colType;
|
||||
execplan::CalpontSystemCatalog::TypeHolderStd colType;
|
||||
colType.colWidth = width;
|
||||
colType.precision = fRow.getPrecision(i);
|
||||
colType.scale = fRow.getScale(i);
|
||||
colType.colDataType = colDataType;
|
||||
fRow.setInt128Field(Dec::int128FromString(aggData.fConstValue, colType), colOut);
|
||||
fRow.setInt128Field(colType.decimal128FromString(aggData.fConstValue), colOut);
|
||||
}
|
||||
else if (width <= datatypes::MAXLEGACYWIDTH)
|
||||
{
|
||||
@ -3812,13 +3811,12 @@ void RowAggregationUM::doNotNullConstantAggregate(const ConstantAggData& aggData
|
||||
auto width = fRow.getColumnWidth(colOut);
|
||||
if (width == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
ColTypeAlias colType;
|
||||
execplan::CalpontSystemCatalog::TypeHolderStd colType;
|
||||
colType.colWidth = width;
|
||||
colType.precision = fRow.getPrecision(i);
|
||||
colType.scale = fRow.getScale(i);
|
||||
colType.colDataType = colDataType;
|
||||
int128_t constValue = Dec::int128FromString(aggData.fConstValue,
|
||||
colType);
|
||||
int128_t constValue = colType.decimal128FromString(aggData.fConstValue);
|
||||
int128_t sum;
|
||||
|
||||
datatypes::MultiplicationOverflowCheck multOp;
|
||||
|
@ -44,7 +44,6 @@ using namespace execplan;
|
||||
#include "rowgroup.h"
|
||||
#include "dataconvert.h"
|
||||
#include "columnwidth.h"
|
||||
#include "widedecimalutils.h"
|
||||
|
||||
#include "collation.h"
|
||||
|
||||
@ -641,7 +640,7 @@ string Row::toString() const
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
if (colWidths[i] == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
unsigned int buflen = utils::MAXLENGTH16BYTES;
|
||||
unsigned int buflen = datatypes::Decimal::MAXLENGTH16BYTES;
|
||||
char *buf = (char*)alloca(buflen);
|
||||
// empty the buffer
|
||||
dataconvert::DataConvert::decimalToString(getBinaryField<int128_t>(i),
|
||||
@ -851,7 +850,7 @@ void Row::initToNull()
|
||||
break;
|
||||
|
||||
case 16 :
|
||||
utils::setWideDecimalNullValue(reinterpret_cast<int128_t&>(data[offsets[i]]));
|
||||
datatypes::Decimal::setWideDecimalNullValue(reinterpret_cast<int128_t&>(data[offsets[i]]));
|
||||
break;
|
||||
default:
|
||||
*((int64_t*) &data[offsets[i]]) = static_cast<int64_t>(joblist::BIGINTNULL);
|
||||
@ -879,7 +878,7 @@ void Row::initToNull()
|
||||
break;
|
||||
case CalpontSystemCatalog::BINARY:
|
||||
{
|
||||
utils::setWideDecimalNullValue(reinterpret_cast<int128_t&>(data[offsets[i]]));
|
||||
datatypes::Decimal::setWideDecimalNullValue(reinterpret_cast<int128_t&>(data[offsets[i]]));
|
||||
}
|
||||
break;
|
||||
|
||||
@ -924,7 +923,7 @@ Row::isNullValue_offset<execplan::CalpontSystemCatalog::BINARY,16>(
|
||||
uint32_t offset) const
|
||||
{
|
||||
const int128_t *intPtr = reinterpret_cast<const int128_t*>(&data[offset]);
|
||||
return utils::isWideDecimalNullValue (*intPtr);
|
||||
return datatypes::Decimal::isWideDecimalNullValue (*intPtr);
|
||||
}
|
||||
|
||||
template<>
|
||||
@ -933,7 +932,7 @@ Row::isNullValue_offset<execplan::CalpontSystemCatalog::DECIMAL,16>(
|
||||
uint32_t offset) const
|
||||
{
|
||||
const int128_t *intPtr = reinterpret_cast<const int128_t*>(&data[offset]);
|
||||
return utils::isWideDecimalNullValue (*intPtr);
|
||||
return datatypes::Decimal::isWideDecimalNullValue (*intPtr);
|
||||
}
|
||||
|
||||
template<>
|
||||
@ -1203,7 +1202,7 @@ bool Row::equals(const Row& r2, const std::vector<uint32_t>& keyCols) const
|
||||
if (getLongDoubleField(col) != r2.getLongDoubleField(col))
|
||||
return false;
|
||||
}
|
||||
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(columnType, colWidths[col])))
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(columnType, colWidths[col])))
|
||||
{
|
||||
if (*getBinaryField<int128_t>(col) != *r2.getBinaryField<int128_t>(col))
|
||||
return false;
|
||||
@ -1262,7 +1261,7 @@ bool Row::equals(const Row& r2, uint32_t lastCol) const
|
||||
if (getLongDoubleField(col) != r2.getLongDoubleField(col))
|
||||
return false;
|
||||
}
|
||||
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(columnType, colWidths[col])))
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(columnType, colWidths[col])))
|
||||
{
|
||||
if (*getBinaryField<int128_t>(col) != *r2.getBinaryField<int128_t>(col))
|
||||
return false;
|
||||
@ -1652,7 +1651,7 @@ void applyMapping(const int* mapping, const Row& in, Row* out)
|
||||
// WIP this doesn't look right b/c we can pushdown colType
|
||||
// Migrate to offset based methods here
|
||||
// code precision 2 width convertor
|
||||
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(in.getColTypes()[i],
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(in.getColTypes()[i],
|
||||
in.getColumnWidth(i))))
|
||||
out->setBinaryField_offset(in.getBinaryField<int128_t>(i), 16,
|
||||
out->getOffset(mapping[i]));
|
||||
|
@ -653,12 +653,12 @@ inline uint32_t Row::getCharsetNumber(uint32_t col) const
|
||||
|
||||
inline bool Row::isCharType(uint32_t colIndex) const
|
||||
{
|
||||
return execplan::isCharType(types[colIndex]);
|
||||
return datatypes::isCharType(types[colIndex]);
|
||||
}
|
||||
|
||||
inline bool Row::isUnsigned(uint32_t colIndex) const
|
||||
{
|
||||
return execplan::isUnsigned(types[colIndex]);
|
||||
return datatypes::isUnsigned(types[colIndex]);
|
||||
}
|
||||
|
||||
inline bool Row::isShortString(uint32_t colIndex) const
|
||||
@ -1277,7 +1277,7 @@ inline void Row::copyField(Row& out, uint32_t destIndex, uint32_t srcIndex) cons
|
||||
{
|
||||
out.setLongDoubleField(getLongDoubleField(srcIndex), destIndex);
|
||||
}
|
||||
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(
|
||||
types[srcIndex], colWidths[srcIndex])))
|
||||
{
|
||||
copyBinaryField<int128_t>(out, destIndex, srcIndex);
|
||||
@ -1724,12 +1724,12 @@ inline uint64_t RowGroup::getSizeWithStrings() const
|
||||
|
||||
inline bool RowGroup::isCharType(uint32_t colIndex) const
|
||||
{
|
||||
return execplan::isCharType(types[colIndex]);
|
||||
return datatypes::isCharType(types[colIndex]);
|
||||
}
|
||||
|
||||
inline bool RowGroup::isUnsigned(uint32_t colIndex) const
|
||||
{
|
||||
return execplan::isUnsigned(types[colIndex]);
|
||||
return datatypes::isUnsigned(types[colIndex]);
|
||||
}
|
||||
|
||||
inline bool RowGroup::isShortString(uint32_t colIndex) const
|
||||
@ -1931,7 +1931,7 @@ inline void copyRow(const Row& in, Row* out, uint32_t colCount)
|
||||
{
|
||||
out->setLongDoubleField(in.getLongDoubleField(i), i);
|
||||
}
|
||||
else if (UNLIKELY(datatypes::Decimal::isWideDecimalType(
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(
|
||||
in.getColType(i), in.getColumnWidth(i))))
|
||||
{
|
||||
in.copyBinaryField<int128_t>(*out, i, i);
|
||||
|
@ -151,7 +151,7 @@ const std::string mcsv1Context::toString() const
|
||||
std::ostringstream output;
|
||||
output << "mcsv1Context: " << getName() << std::endl;
|
||||
output << " RunFlags=" << fRunFlags << " ContextFlags=" << fContextFlags << std::endl;
|
||||
output << " UserDataSize=" << fUserDataSize << " ResultType=" << colDataTypeToString(fResultType) << std::endl;
|
||||
output << " UserDataSize=" << fUserDataSize << " ResultType=" << execplan::colDataTypeToString(fResultType) << std::endl;
|
||||
output << " Resultscale=" << fResultscale << " ResultPrecision=" << fResultPrecision << std::endl;
|
||||
output << " ErrorMsg=" << errorMsg << std::endl;
|
||||
output << " bInterrupted=" << bInterrupted << std::endl;
|
||||
|
@ -793,7 +793,7 @@ void* WindowFunctionType::getNullValueByType(int ct, int pos)
|
||||
break;
|
||||
|
||||
case 16:
|
||||
utils::setWideDecimalNullValue(int128Null);
|
||||
datatypes::Decimal::setWideDecimalNullValue(int128Null);
|
||||
v = &int128Null;
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user