You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
No boost condition (#2822)
This patch replaces boost primitives with stdlib counterparts.
This commit is contained in:
@ -23,7 +23,8 @@
|
||||
|
||||
#include <string>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#include <map>
|
||||
#include <mutex>
|
||||
#include <boost/uuid/uuid_io.hpp>
|
||||
|
||||
#include "querytele.h"
|
||||
@ -80,12 +81,12 @@ namespace
|
||||
return ival;
|
||||
}
|
||||
|
||||
void normalizeIntToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeIntToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -93,20 +94,20 @@ namespace
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeIntToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
int64_t val = datatypes::applySignedScale<int64_t>(in.getIntField(i), diff);
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeIntToUintNoScale(const Row& in, Row* out, uint32_t i)
|
||||
|
||||
void normalizeIntToUintNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setUintField(in.getIntField(i), i);
|
||||
out->setUintField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeIntToUintWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToUintWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -114,7 +115,7 @@ namespace
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeIntToUintWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToUintWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -122,7 +123,7 @@ namespace
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeIntToStringWithScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToStringWithScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
ostringstream os;
|
||||
double d = in.getIntField(i);
|
||||
@ -133,7 +134,7 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeIntToStringNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToStringNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
ostringstream os;
|
||||
os << in.getIntField(i);
|
||||
@ -141,25 +142,25 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeIntToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledSInt64FieldAsXFloat<double>(i);
|
||||
out->setFloatField((float)d, i);
|
||||
}
|
||||
|
||||
void normalizeIntToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledSInt64FieldAsXFloat<double>(i);
|
||||
out->setDoubleField(d, i);
|
||||
}
|
||||
|
||||
void normalizeIntToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledSInt64FieldAsXFloat<long double>(i);
|
||||
out->setLongDoubleField(d, i);
|
||||
}
|
||||
|
||||
void normalizeIntToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -167,7 +168,7 @@ namespace
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeIntToXDecimalInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeIntToXDecimalInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -175,12 +176,12 @@ namespace
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeUintToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getUintField(i), i);
|
||||
out->setIntField(in.getUintField(i), i);
|
||||
}
|
||||
|
||||
void normalizeUintToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -188,7 +189,7 @@ namespace
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeUntToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUntToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -196,12 +197,12 @@ namespace
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeUintToUint(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToUint(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setUintField(in.getUintField(i), i);
|
||||
out->setUintField(in.getUintField(i), i);
|
||||
}
|
||||
|
||||
void normalizeUintToStringWithScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToStringWithScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
ostringstream os;
|
||||
double d = in.getUintField(i);
|
||||
@ -212,7 +213,7 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeUintToStringNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToStringNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
ostringstream os;
|
||||
os << in.getUintField(i);
|
||||
@ -220,25 +221,25 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizUintToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizUintToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledUInt64FieldAsXFloat<double>(i);
|
||||
out->setFloatField((float)d, i);
|
||||
}
|
||||
|
||||
void normalizeUintToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledUInt64FieldAsXFloat<double>(i);
|
||||
out->setDoubleField(d, i);
|
||||
}
|
||||
|
||||
void normalizeUintToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
auto d = in.getScaledUInt64FieldAsXFloat<long double>(i);
|
||||
out->setLongDoubleField(d, i);
|
||||
}
|
||||
|
||||
void normalizeUintToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -246,7 +247,7 @@ namespace
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeUintToXDecimalInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeUintToXDecimalInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
const int diff = out->getScale(i) - in.getScale(i);
|
||||
idbassert(diff >= 0);
|
||||
@ -254,17 +255,17 @@ namespace
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeStringToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeStringToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setStringField(in.getStringField(i), i);
|
||||
}
|
||||
|
||||
void normalizeDateToDate(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDateToDate(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeDateToDatetime(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDateToDatetime(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
uint64_t date = in.getUintField(i);
|
||||
date &= ~0x3f; // zero the 'spare' field
|
||||
@ -272,7 +273,7 @@ namespace
|
||||
out->setUintField(date, i);
|
||||
}
|
||||
|
||||
void normalizeDateToTimestamp(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
void normalizeDateToTimestamp(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
{
|
||||
dataconvert::Date date(in.getUintField(i));
|
||||
dataconvert::MySQLTime m_time;
|
||||
@ -302,26 +303,26 @@ namespace
|
||||
out->setUintField(outValue, i);
|
||||
}
|
||||
|
||||
void normalizeDateToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDateToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
string d = DataConvert::dateToString(in.getUintField(i));
|
||||
utils::NullString ns(d);
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeDatetimeToDatetime(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDatetimeToDatetime(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeDatetimeToDate(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDatetimeToDate(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
uint64_t val = in.getUintField(i);
|
||||
val >>= 32;
|
||||
out->setUintField(val, i);
|
||||
}
|
||||
|
||||
void normalizeDatetimeToTimestamp(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
void normalizeDatetimeToTimestamp(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
{
|
||||
uint64_t val = in.getUintField(i);
|
||||
dataconvert::DateTime dtime(val);
|
||||
@ -353,19 +354,19 @@ namespace
|
||||
out->setUintField(outValue, i);
|
||||
}
|
||||
|
||||
void normalizeDatetimeToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeDatetimeToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
string d = DataConvert::datetimeToString(in.getUintField(i));
|
||||
utils::NullString ns(d);
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeTimestampToTimestamp(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeTimestampToTimestamp(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeTimestampToDate(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
void normalizeTimestampToDate(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
{
|
||||
uint64_t val = in.getUintField(i);
|
||||
dataconvert::TimeStamp timestamp(val);
|
||||
@ -385,7 +386,7 @@ namespace
|
||||
out->setUintField(outValue, i);
|
||||
}
|
||||
|
||||
void normalizeTimestampToDatetime(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
void normalizeTimestampToDatetime(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
{
|
||||
uint64_t val = in.getUintField(i);
|
||||
dataconvert::TimeStamp timestamp(val);
|
||||
@ -408,110 +409,110 @@ namespace
|
||||
out->setUintField(outValue, i);
|
||||
}
|
||||
|
||||
void normalizeTimestampToString(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
void normalizeTimestampToString(const Row& in, Row* out, uint32_t i, long fTimeZone)
|
||||
{
|
||||
string d = DataConvert::timestampToString(in.getUintField(i), fTimeZone);
|
||||
utils::NullString ns(d);
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeTimeToTime(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeTimeToTime(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
out->setIntField(in.getIntField(i), i);
|
||||
}
|
||||
|
||||
void normalizeTimeToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeTimeToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
string d = DataConvert::timeToString(in.getIntField(i));
|
||||
utils::NullString ns(d);
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setInt128Field(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setInt128Field(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setIntField(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToIntWithScaleInt64(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setIntField(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setIntField((int64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setIntField((int64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToUint(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToUint(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setUintField((uint64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToUint(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToUint(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setUintField((uint64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setFloatField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setFloatField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setLongDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setLongDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
ostringstream os;
|
||||
@ -521,7 +522,7 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
ostringstream os;
|
||||
@ -531,73 +532,73 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToWideXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToWideXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setInt128Field(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToWideXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToWideXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setInt128Field(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXFloatToXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXFloatToXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getFloatField(i);
|
||||
out->setIntField(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeXDoubleToXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDoubleToXDecimal(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
double val = in.getDoubleField(i);
|
||||
out->setIntField(pickScaleForDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToIntNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setIntField((int64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToIntWithScaleInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setInt128Field(pickScaleForLongDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToIntWithScaleInt(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToIntWithScaleInt(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setIntField(pickScaleForLongDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToUint(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToUint(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setUintField((uint64_t)val, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setFloatField(val, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setLongDoubleField(val, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
ostringstream os;
|
||||
@ -607,32 +608,32 @@ namespace
|
||||
out->setStringField(ns, i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToXDecimalInt128(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setInt128Field(pickScaleForLongDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeLongDoubleToXDecimalInt(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeLongDoubleToXDecimalInt(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
long double val = in.getLongDoubleField(i);
|
||||
out->setIntField(pickScaleForLongDouble(out, i, val), i);
|
||||
}
|
||||
|
||||
void normalizeWideXDecimalToWideXDecimalNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeWideXDecimalToWideXDecimalNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int128_t val128 = 0;
|
||||
in.getInt128Field(i, val128);
|
||||
out->setInt128Field(val128, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToWideXDecimalNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToWideXDecimalNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
int64_t val = in.getIntField(i);
|
||||
out->setInt128Field(val, i);
|
||||
}
|
||||
|
||||
void normalizeWideXDecimalToWideXDecimalWithScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeWideXDecimalToWideXDecimalWithScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int128_t val128 = 0;
|
||||
in.getInt128Field(i, val128);
|
||||
@ -640,48 +641,48 @@ namespace
|
||||
out->setInt128Field(temp, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToWideXDecimalWithScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToWideXDecimalWithScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
int128_t temp = datatypes::applySignedScale<int128_t>(val, out->getScale(i) - in.getScale(i));
|
||||
out->setInt128Field(temp, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToOtherNoScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToOtherNoScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
out->setIntField(val, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToOtherWithScale(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToOtherWithScale(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
int64_t temp = datatypes::applySignedScale<int64_t>(val, out->getScale(i) - in.getScale(i));
|
||||
out->setIntField(temp, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToXFloat(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
float fval = ((float)val) / IDB_pow[in.getScale(i)];
|
||||
out->setFloatField(fval, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToXDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
double dval = ((double)val) / IDB_pow[in.getScale(i)];
|
||||
out->setDoubleField(dval, i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToLongDouble(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
long double dval = ((long double)val) / IDB_pow[in.getScale(i)];
|
||||
out->setLongDoubleField(dval, i);
|
||||
}
|
||||
|
||||
void normalizeWideXDecimalToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeWideXDecimalToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int128_t val128 = 0;
|
||||
in.getInt128Field(i, val128);
|
||||
@ -689,14 +690,14 @@ namespace
|
||||
out->setStringField(dec.toNullString(), i);
|
||||
}
|
||||
|
||||
void normalizeXDecimalToString(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeXDecimalToString(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
int64_t val = in.getIntField(i);
|
||||
datatypes::Decimal dec(val, in.getScale(i), in.getPrecision(i));
|
||||
out->setStringField(dec.toNullString(), i);
|
||||
}
|
||||
|
||||
void normalizeBlobVarbinary(const Row& in, Row* out, uint32_t i)
|
||||
void normalizeBlobVarbinary(const Row& in, Row* out, uint32_t i)
|
||||
{
|
||||
// out->setVarBinaryField(in.getVarBinaryStringField(i), i); // not efficient
|
||||
out->setVarBinaryField(in.getVarBinaryField(i), in.getVarBinaryLength(i), i);
|
||||
@ -724,15 +725,15 @@ namespace
|
||||
case CalpontSystemCatalog::INT:
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
{
|
||||
if (out->getScale(i) || in.getScale(i))
|
||||
if (out->getScale(i) || in.getScale(i))
|
||||
{
|
||||
if (out->getColumnWidth(i) == datatypes::MAXDECIMALWIDTH)
|
||||
result.emplace_back(normalizeIntToIntWithScaleInt128);
|
||||
else
|
||||
result.emplace_back(normalizeIntToIntWithScaleInt64);
|
||||
}
|
||||
}
|
||||
else
|
||||
result.emplace_back(normalizeIntToIntNoScale);
|
||||
result.emplace_back(normalizeIntToIntNoScale);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -748,15 +749,15 @@ namespace
|
||||
result.emplace_back(normalizeIntToUintWithScaleInt128);
|
||||
else
|
||||
result.emplace_back(normalizeIntToUintWithScaleInt64);
|
||||
}
|
||||
}
|
||||
else
|
||||
result.emplace_back(normalizeIntToUintNoScale);
|
||||
result.emplace_back(normalizeIntToUintNoScale);
|
||||
break;
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
{
|
||||
if (in.getScale(i))
|
||||
result.emplace_back(normalizeIntToStringWithScale);
|
||||
@ -829,9 +830,9 @@ namespace
|
||||
result.emplace_back(normalizeUintToIntWithScaleInt128);
|
||||
else
|
||||
result.emplace_back(normalizeUntToIntWithScaleInt64);
|
||||
}
|
||||
}
|
||||
else
|
||||
result.emplace_back(normalizeUintToIntNoScale);
|
||||
result.emplace_back(normalizeUintToIntNoScale);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -843,7 +844,7 @@ namespace
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
{
|
||||
if (in.getScale(i))
|
||||
result.emplace_back(normalizeUintToStringWithScale);
|
||||
@ -851,7 +852,7 @@ namespace
|
||||
result.emplace_back(normalizeUintToStringNoScale);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case CalpontSystemCatalog::DATE:
|
||||
case CalpontSystemCatalog::DATETIME:
|
||||
case CalpontSystemCatalog::TIME:
|
||||
@ -920,7 +921,7 @@ namespace
|
||||
case CalpontSystemCatalog::DATETIME: result.emplace_back(normalizeDateToDatetime); break;
|
||||
|
||||
case CalpontSystemCatalog::TIMESTAMP: result.emplace_back(std::bind(normalizeDateToTimestamp, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, fTimeZone)); break;
|
||||
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR: result.emplace_back(normalizeDateToString); break;
|
||||
@ -965,9 +966,9 @@ namespace
|
||||
case CalpontSystemCatalog::TIMESTAMP: result.emplace_back(normalizeTimestampToTimestamp); break;
|
||||
|
||||
case CalpontSystemCatalog::DATE: result.emplace_back(std::bind(normalizeTimestampToDate, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, fTimeZone)); break;
|
||||
|
||||
|
||||
case CalpontSystemCatalog::DATETIME: result.emplace_back(std::bind(normalizeTimestampToDatetime, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, fTimeZone)); break;
|
||||
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR: result.emplace_back(std::bind(normalizeTimestampToString, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, fTimeZone)); break;
|
||||
@ -1031,7 +1032,7 @@ namespace
|
||||
else
|
||||
result.emplace_back(normalizeXDoubleToIntWithScaleInt64);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
@ -1046,7 +1047,7 @@ namespace
|
||||
case CalpontSystemCatalog::USMALLINT:
|
||||
case CalpontSystemCatalog::UMEDINT:
|
||||
case CalpontSystemCatalog::UINT:
|
||||
case CalpontSystemCatalog::UBIGINT:
|
||||
case CalpontSystemCatalog::UBIGINT:
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToUint);
|
||||
@ -1056,7 +1057,7 @@ namespace
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::FLOAT:
|
||||
case CalpontSystemCatalog::UFLOAT:
|
||||
case CalpontSystemCatalog::UFLOAT:
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToXFloat);
|
||||
@ -1064,9 +1065,9 @@ namespace
|
||||
result.emplace_back(normalizeXDoubleToXFloat);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case CalpontSystemCatalog::DOUBLE:
|
||||
case CalpontSystemCatalog::UDOUBLE:
|
||||
case CalpontSystemCatalog::UDOUBLE:
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToXDouble);
|
||||
@ -1074,8 +1075,8 @@ namespace
|
||||
result.emplace_back(normalizeXDoubleToXDouble);
|
||||
break;
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::LONGDOUBLE:
|
||||
|
||||
case CalpontSystemCatalog::LONGDOUBLE:
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToLongDouble);
|
||||
@ -1083,18 +1084,18 @@ namespace
|
||||
result.emplace_back(normalizeXDoubleToLongDouble);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToString);
|
||||
else
|
||||
result.emplace_back(normalizeXDoubleToString);
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
@ -1112,14 +1113,14 @@ namespace
|
||||
result.emplace_back(normalizeXDoubleToWideXDecimal);
|
||||
break;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
if (in.getColTypes()[i] == CalpontSystemCatalog::FLOAT || in.getColTypes()[i] == CalpontSystemCatalog::UFLOAT)
|
||||
result.emplace_back(normalizeXFloatToXDecimal);
|
||||
else
|
||||
result.emplace_back(normalizeXDoubleToXDecimal);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1149,9 +1150,9 @@ namespace
|
||||
result.emplace_back(normalizeLongDoubleToIntWithScaleInt128);
|
||||
else
|
||||
result.emplace_back(normalizeLongDoubleToIntWithScaleInt);
|
||||
}
|
||||
}
|
||||
else
|
||||
result.emplace_back(normalizeLongDoubleToIntNoScale);
|
||||
result.emplace_back(normalizeLongDoubleToIntNoScale);
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1185,7 +1186,7 @@ namespace
|
||||
result.emplace_back(normalizeLongDoubleToXDecimalInt128);
|
||||
else
|
||||
result.emplace_back(normalizeLongDoubleToXDecimalInt);
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -1252,7 +1253,7 @@ namespace
|
||||
}
|
||||
|
||||
case CalpontSystemCatalog::FLOAT:
|
||||
case CalpontSystemCatalog::UFLOAT: result.emplace_back(normalizeXDecimalToXFloat); break;
|
||||
case CalpontSystemCatalog::UFLOAT: result.emplace_back(normalizeXDecimalToXFloat); break;
|
||||
|
||||
case CalpontSystemCatalog::DOUBLE:
|
||||
case CalpontSystemCatalog::UDOUBLE: result.emplace_back(normalizeXDecimalToXDouble); break;
|
||||
@ -1462,7 +1463,7 @@ void TupleUnion::readInput(uint32_t which)
|
||||
|
||||
l_tmpRG.getRow(0, &tmpRow);
|
||||
{
|
||||
boost::mutex::scoped_lock lk(uniquerMutex);
|
||||
std::unique_lock lk(uniquerMutex);
|
||||
getOutput(&l_outputRG, &outRow, &outRGData);
|
||||
memUsageBefore = allocator.getMemUsage();
|
||||
|
||||
@ -1541,8 +1542,8 @@ void TupleUnion::readInput(uint32_t which)
|
||||
more = dl->next(it, &inRGData);
|
||||
|
||||
{
|
||||
boost::mutex::scoped_lock lock1(uniquerMutex);
|
||||
boost::mutex::scoped_lock lock2(sMutex);
|
||||
std::unique_lock lock1(uniquerMutex);
|
||||
std::unique_lock lock2(sMutex);
|
||||
|
||||
if (!distinct && l_outputRG.getRowCount() > 0)
|
||||
output->insert(outRGData);
|
||||
@ -1640,7 +1641,7 @@ void TupleUnion::addToOutput(Row* r, RowGroup* rg, bool keepit, RGData& data, ui
|
||||
{
|
||||
rg->setRowCount(8192);
|
||||
{
|
||||
boost::mutex::scoped_lock lock(sMutex);
|
||||
std::unique_lock lock(sMutex);
|
||||
output->insert(data);
|
||||
}
|
||||
data = RGData(*rg);
|
||||
@ -1677,7 +1678,7 @@ void TupleUnion::run()
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
boost::mutex::scoped_lock lk(jlLock);
|
||||
std::unique_lock lk(jlLock);
|
||||
|
||||
if (runRan)
|
||||
return;
|
||||
@ -1720,7 +1721,7 @@ void TupleUnion::run()
|
||||
|
||||
void TupleUnion::join()
|
||||
{
|
||||
boost::mutex::scoped_lock lk(jlLock);
|
||||
std::unique_lock lk(jlLock);
|
||||
|
||||
if (joinRan)
|
||||
return;
|
||||
|
Reference in New Issue
Block a user