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
Remove hi_val/lo_val data members from EMCasualPartition_struct
and use the union members instead.
This commit is contained in:
committed by
Roman Nozdrin
parent
1588ebe439
commit
62c1c1e0e2
@ -335,8 +335,8 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*min = entry.partition.cprange.lo_val;
|
*min = entry.partition.cprange.loVal;
|
||||||
*max = entry.partition.cprange.hi_val;
|
*max = entry.partition.cprange.hiVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
*seq = entry.partition.cprange.sequenceNum;
|
*seq = entry.partition.cprange.sequenceNum;
|
||||||
@ -364,8 +364,8 @@ int LBIDList::getMinMaxFromEntries(T& min, T& max, int32_t& seq,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
min = EMEntries[i].partition.cprange.lo_val;
|
min = EMEntries[i].partition.cprange.loVal;
|
||||||
max = EMEntries[i].partition.cprange.hi_val;
|
max = EMEntries[i].partition.cprange.hiVal;
|
||||||
}
|
}
|
||||||
seq = EMEntries[i].partition.cprange.sequenceNum;
|
seq = EMEntries[i].partition.cprange.sequenceNum;
|
||||||
return EMEntries[i].partition.cprange.isValid;
|
return EMEntries[i].partition.cprange.isValid;
|
||||||
@ -757,7 +757,6 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
bool scan = true;
|
bool scan = true;
|
||||||
int64_t value = 0;
|
int64_t value = 0;
|
||||||
__int128 bigValue = 0;
|
__int128 bigValue = 0;
|
||||||
uint64_t* int128Ptr = reinterpret_cast<uint64_t*>(&bigValue);
|
|
||||||
bool bIsUnsigned = execplan::isUnsigned(ct.colDataType);
|
bool bIsUnsigned = execplan::isUnsigned(ct.colDataType);
|
||||||
bool bIsChar = execplan::isCharType(ct.colDataType);
|
bool bIsChar = execplan::isCharType(ct.colDataType);
|
||||||
|
|
||||||
@ -806,15 +805,14 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
{
|
{
|
||||||
uint64_t val = *(int64_t*)MsgDataPtr;
|
uint64_t val = *(int64_t*)MsgDataPtr;
|
||||||
value = static_cast<int64_t>(val);
|
value = static_cast<int64_t>(val);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
{
|
{
|
||||||
unsigned __int128 val;
|
uint128_t val = *(int128_t*)MsgDataPtr;
|
||||||
int128Ptr = reinterpret_cast<uint64_t*>(&val);
|
bigValue = static_cast<int128_t>(val);
|
||||||
int128Ptr[0] = *reinterpret_cast<const uint64_t*>(MsgDataPtr);
|
break;
|
||||||
int128Ptr[1] = *(reinterpret_cast<const uint64_t*>(MsgDataPtr) + 1);
|
|
||||||
bigValue = static_cast<__int128>(val);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -847,12 +845,14 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
{
|
{
|
||||||
int64_t val = *(int64_t*)MsgDataPtr;
|
int64_t val = *(int64_t*)MsgDataPtr;
|
||||||
value = val;
|
value = val;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 16:
|
case 16:
|
||||||
{
|
{
|
||||||
int128Ptr[0] = *reinterpret_cast<const uint64_t*>(MsgDataPtr);
|
int128_t val = *(int128_t*)MsgDataPtr;
|
||||||
int128Ptr[1] = *(reinterpret_cast<const uint64_t*>(MsgDataPtr) + 1);
|
bigValue = val;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -875,8 +875,8 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
{
|
{
|
||||||
// MCOL-1246 Trim trailing whitespace for matching so that we have
|
// MCOL-1246 Trim trailing whitespace for matching so that we have
|
||||||
// the same as InnoDB behaviour
|
// the same as InnoDB behaviour
|
||||||
int64_t tMin = cpRange.lo_val;
|
int64_t tMin = cpRange.loVal;
|
||||||
int64_t tMax = cpRange.hi_val;
|
int64_t tMax = cpRange.hiVal;
|
||||||
dataconvert::DataConvert::trimWhitespace(tMin);
|
dataconvert::DataConvert::trimWhitespace(tMin);
|
||||||
dataconvert::DataConvert::trimWhitespace(tMax);
|
dataconvert::DataConvert::trimWhitespace(tMax);
|
||||||
|
|
||||||
@ -886,22 +886,22 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
}
|
}
|
||||||
else if (bIsUnsigned)
|
else if (bIsUnsigned)
|
||||||
{
|
{
|
||||||
if (ct.colWidth <= 8)
|
if (ct.colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
scan = compareVal(static_cast<uint64_t>(cpRange.lo_val), static_cast<uint64_t>(cpRange.hi_val), static_cast<uint64_t>(value), op, lcf);
|
scan = compareVal(static_cast<uint64_t>(cpRange.loVal), static_cast<uint64_t>(cpRange.hiVal), static_cast<uint64_t>(value), op, lcf);
|
||||||
}
|
}
|
||||||
else if (ct.colWidth == 16)
|
else
|
||||||
{
|
{
|
||||||
scan = compareVal(static_cast<unsigned __int128>(cpRange.bigLoVal), static_cast<unsigned __int128>(cpRange.bigHiVal), static_cast<unsigned __int128>(bigValue), op, lcf);
|
scan = compareVal(static_cast<unsigned __int128>(cpRange.bigLoVal), static_cast<unsigned __int128>(cpRange.bigHiVal), static_cast<unsigned __int128>(bigValue), op, lcf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (ct.colWidth <= 8)
|
if (ct.colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
scan = compareVal(cpRange.lo_val, cpRange.hi_val, value, op, lcf);
|
scan = compareVal(cpRange.loVal, cpRange.hiVal, value, op, lcf);
|
||||||
}
|
}
|
||||||
else if (ct.colWidth == 16)
|
else
|
||||||
{
|
{
|
||||||
scan = compareVal(cpRange.bigLoVal, cpRange.bigHiVal, bigValue, op, lcf);
|
scan = compareVal(cpRange.bigLoVal, cpRange.bigHiVal, bigValue, op, lcf);
|
||||||
}
|
}
|
||||||
|
@ -739,8 +739,8 @@ void pColStep::sendPrimitiveMessages()
|
|||||||
// {
|
// {
|
||||||
//
|
//
|
||||||
// bool flag = lbidList->CasualPartitionPredicate(
|
// bool flag = lbidList->CasualPartitionPredicate(
|
||||||
// extents[idx].partition.cprange.lo_val,
|
// extents[idx].partition.cprange.loVal,
|
||||||
// extents[idx].partition.cprange.hi_val,
|
// extents[idx].partition.cprange.hiVal,
|
||||||
// &fFilterString,
|
// &fFilterString,
|
||||||
// fFilterCount,
|
// fFilterCount,
|
||||||
// fColType,
|
// fColType,
|
||||||
@ -749,8 +749,8 @@ void pColStep::sendPrimitiveMessages()
|
|||||||
//#ifdef DEBUG
|
//#ifdef DEBUG
|
||||||
// if (fOid >= 3000 && flushInterval == 0)
|
// if (fOid >= 3000 && flushInterval == 0)
|
||||||
// cout << (flag ? " will scan " : " will not scan ")
|
// cout << (flag ? " will scan " : " will not scan ")
|
||||||
// << "extent with range " << extents[idx].partition.cprange.lo_val
|
// << "extent with range " << extents[idx].partition.cprange.loVal
|
||||||
// << "-" << extents[idx].partition.cprange.hi_val << endl;
|
// << "-" << extents[idx].partition.cprange.hiVal << endl;
|
||||||
//#endif
|
//#endif
|
||||||
//
|
//
|
||||||
// }
|
// }
|
||||||
|
@ -48,8 +48,8 @@ void PseudoCCJL::runCommand(ByteStream& bs) const
|
|||||||
{
|
{
|
||||||
if (!datatypes::Decimal::isWideDecimalType(colType))
|
if (!datatypes::Decimal::isWideDecimalType(colType))
|
||||||
{
|
{
|
||||||
int64_t max = extents[currentExtentIndex].partition.cprange.hi_val;
|
int64_t max = extents[currentExtentIndex].partition.cprange.hiVal;
|
||||||
int64_t min = extents[currentExtentIndex].partition.cprange.lo_val;
|
int64_t min = extents[currentExtentIndex].partition.cprange.loVal;
|
||||||
|
|
||||||
if (extents[currentExtentIndex].partition.cprange.isValid == BRM::CP_VALID && max >= min)
|
if (extents[currentExtentIndex].partition.cprange.isValid == BRM::CP_VALID && max >= min)
|
||||||
bs << max;
|
bs << max;
|
||||||
@ -75,8 +75,8 @@ void PseudoCCJL::runCommand(ByteStream& bs) const
|
|||||||
{
|
{
|
||||||
if (!datatypes::Decimal::isWideDecimalType(colType))
|
if (!datatypes::Decimal::isWideDecimalType(colType))
|
||||||
{
|
{
|
||||||
int64_t max = extents[currentExtentIndex].partition.cprange.hi_val;
|
int64_t max = extents[currentExtentIndex].partition.cprange.hiVal;
|
||||||
int64_t min = extents[currentExtentIndex].partition.cprange.lo_val;
|
int64_t min = extents[currentExtentIndex].partition.cprange.loVal;
|
||||||
|
|
||||||
if (extents[currentExtentIndex].partition.cprange.isValid == BRM::CP_VALID && max >= min)
|
if (extents[currentExtentIndex].partition.cprange.isValid == BRM::CP_VALID && max >= min)
|
||||||
bs << min;
|
bs << min;
|
||||||
|
@ -200,7 +200,7 @@ uint32_t RowEstimator::estimateDistinctValues(const execplan::CalpontSystemCatal
|
|||||||
ret = max - min + 1;
|
ret = max - min + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret > (T) fRowsPerExtent)
|
if (ret > fRowsPerExtent)
|
||||||
{
|
{
|
||||||
ret = fRowsPerExtent;
|
ret = fRowsPerExtent;
|
||||||
}
|
}
|
||||||
@ -251,7 +251,7 @@ float RowEstimator::estimateOpFactor(const T& min, const T& max, const T& value,
|
|||||||
if (!datatypes::Decimal::isWideDecimalType(ct))
|
if (!datatypes::Decimal::isWideDecimalType(ct))
|
||||||
factor = (1.0 * max - value) / (1.0 * max - min + 1);
|
factor = (1.0 * max - value) / (1.0 * max - min + 1);
|
||||||
else
|
else
|
||||||
factor = (1.0 * max - value) / (1.0 * max - min + 1);
|
factor = ((__float128) max - value) / (max - min + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -264,7 +264,7 @@ float RowEstimator::estimateOpFactor(const T& min, const T& max, const T& value,
|
|||||||
if (!datatypes::Decimal::isWideDecimalType(ct))
|
if (!datatypes::Decimal::isWideDecimalType(ct))
|
||||||
factor = (1.0 * max - value + 1) / (max - min + 1);
|
factor = (1.0 * max - value + 1) / (max - min + 1);
|
||||||
else
|
else
|
||||||
factor = (1.0 * max - value + 1) / (max - min + 1);
|
factor = ((__float128) max - value + 1) / (max - min + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -310,8 +310,8 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry,
|
|||||||
// Adjust values based on column type and estimate the
|
// Adjust values based on column type and estimate the
|
||||||
if (!datatypes::Decimal::isWideDecimalType(ct))
|
if (!datatypes::Decimal::isWideDecimalType(ct))
|
||||||
{
|
{
|
||||||
adjustedMin = adjustValue(ct, emEntry.partition.cprange.lo_val);
|
adjustedMin = adjustValue(ct, emEntry.partition.cprange.loVal);
|
||||||
adjustedMax = adjustValue(ct, emEntry.partition.cprange.hi_val);
|
adjustedMax = adjustValue(ct, emEntry.partition.cprange.hiVal);
|
||||||
distinctValuesEstimate = estimateDistinctValues(
|
distinctValuesEstimate = estimateDistinctValues(
|
||||||
ct, adjustedMin, adjustedMax, emEntry.partition.cprange.isValid);
|
ct, adjustedMin, adjustedMax, emEntry.partition.cprange.isValid);
|
||||||
}
|
}
|
||||||
@ -452,8 +452,8 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if ROW_EST_DEBUG
|
#if ROW_EST_DEBUG
|
||||||
cout << " Min-" << emEntry.partition.cprange.lo_val <<
|
cout << " Min-" << emEntry.partition.cprange.loVal <<
|
||||||
", Max-" << emEntry.partition.cprange.hi_val <<
|
", Max-" << emEntry.partition.cprange.hiVal <<
|
||||||
", Val-" << value;
|
", Val-" << value;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -685,16 +685,5 @@ uint64_t RowEstimator::estimateRowsForNonCPColumn(ColumnCommandJL& colCmd)
|
|||||||
return estimatedRows;
|
return estimatedRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
template
|
|
||||||
uint32_t RowEstimator::estimateDistinctValues<int128_t>(const execplan::CalpontSystemCatalog::ColType& ct,
|
|
||||||
const int128_t& min,
|
|
||||||
const int128_t& max,
|
|
||||||
const char cpStatus);
|
|
||||||
|
|
||||||
template
|
|
||||||
uint32_t RowEstimator::estimateDistinctValues<int64_t>(const execplan::CalpontSystemCatalog::ColType& ct,
|
|
||||||
const int64_t& min,
|
|
||||||
const int64_t& max,
|
|
||||||
const char cpStatus);
|
|
||||||
|
|
||||||
} //namespace joblist
|
} //namespace joblist
|
||||||
|
@ -1584,7 +1584,7 @@ bool TupleBPS::processSingleFilterString(int8_t BOP, int8_t colWidth, T val, con
|
|||||||
throw logic_error("invalid column width");
|
throw logic_error("invalid column width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colWidth < 16)
|
if (colWidth < datatypes::MAXDECIMALWIDTH)
|
||||||
thisPredicate = compareSingleValue(COP, (int64_t) val, val2);
|
thisPredicate = compareSingleValue(COP, (int64_t) val, val2);
|
||||||
else
|
else
|
||||||
thisPredicate = compareSingleValue(COP, (int128_t) val, bigVal2);
|
thisPredicate = compareSingleValue(COP, (int128_t) val, bigVal2);
|
||||||
@ -1694,11 +1694,11 @@ bool TupleBPS::processPseudoColFilters(uint32_t extentIndex, boost::shared_ptr<m
|
|||||||
&& (!hasExtentIDFilter || processOneFilterType(8, emEntry.range.start, PSEUDO_EXTENTID))
|
&& (!hasExtentIDFilter || processOneFilterType(8, emEntry.range.start, PSEUDO_EXTENTID))
|
||||||
&& (!hasMaxFilter || (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
&& (!hasMaxFilter || (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
||||||
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
||||||
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.hi_val, PSEUDO_EXTENTMAX) :
|
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.hiVal, PSEUDO_EXTENTMAX) :
|
||||||
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigHiVal, PSEUDO_EXTENTMAX)) : true))
|
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigHiVal, PSEUDO_EXTENTMAX)) : true))
|
||||||
&& (!hasMinFilter || (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
&& (!hasMinFilter || (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
||||||
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
||||||
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.lo_val, PSEUDO_EXTENTMIN) :
|
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.loVal, PSEUDO_EXTENTMIN) :
|
||||||
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigLoVal, PSEUDO_EXTENTMIN)) : true))
|
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigLoVal, PSEUDO_EXTENTMIN)) : true))
|
||||||
&& (!hasLBIDFilter || processLBIDFilter(emEntry))
|
&& (!hasLBIDFilter || processLBIDFilter(emEntry))
|
||||||
;
|
;
|
||||||
@ -1712,11 +1712,11 @@ bool TupleBPS::processPseudoColFilters(uint32_t extentIndex, boost::shared_ptr<m
|
|||||||
|| (hasExtentIDFilter && processOneFilterType(8, emEntry.range.start, PSEUDO_EXTENTID))
|
|| (hasExtentIDFilter && processOneFilterType(8, emEntry.range.start, PSEUDO_EXTENTID))
|
||||||
|| (hasMaxFilter && (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
|| (hasMaxFilter && (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
||||||
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
||||||
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.hi_val, PSEUDO_EXTENTMAX) :
|
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.hiVal, PSEUDO_EXTENTMAX) :
|
||||||
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigHiVal, PSEUDO_EXTENTMAX)) : false))
|
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigHiVal, PSEUDO_EXTENTMAX)) : false))
|
||||||
|| (hasMinFilter && (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
|| (hasMinFilter && (emEntry.partition.cprange.isValid == BRM::CP_VALID ?
|
||||||
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
(!datatypes::Decimal::isWideDecimalType(fColType) ?
|
||||||
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.lo_val, PSEUDO_EXTENTMIN) :
|
processOneFilterType(emEntry.range.size, emEntry.partition.cprange.loVal, PSEUDO_EXTENTMIN) :
|
||||||
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigLoVal, PSEUDO_EXTENTMIN)) : false))
|
processOneFilterType(fColType.colWidth, emEntry.partition.cprange.bigLoVal, PSEUDO_EXTENTMIN)) : false))
|
||||||
|| (hasLBIDFilter && processLBIDFilter(emEntry))
|
|| (hasLBIDFilter && processLBIDFilter(emEntry))
|
||||||
;
|
;
|
||||||
|
@ -1299,8 +1299,8 @@ extern "C"
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
output << setw(10) << "Part#"
|
output << setw(10) << "Part#"
|
||||||
<< setw(42) << "Min"
|
<< setw(utils::MAXLENGTH16BYTES) << "Min"
|
||||||
<< setw(42) << "Max" << "Status";
|
<< setw(utils::MAXLENGTH16BYTES) << "Max" << "Status";
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t maxLimit = numeric_limits<int64_t>::max();
|
int64_t maxLimit = numeric_limits<int64_t>::max();
|
||||||
@ -1334,7 +1334,7 @@ extern "C"
|
|||||||
if (!datatypes::Decimal::isWideDecimalType(ct))
|
if (!datatypes::Decimal::isWideDecimalType(ct))
|
||||||
output << setw(30) << "N/A" << setw(30) << "N/A";
|
output << setw(30) << "N/A" << setw(30) << "N/A";
|
||||||
else
|
else
|
||||||
output << setw(42) << "N/A" << setw(42) << "N/A";
|
output << setw(utils::MAXLENGTH16BYTES) << "N/A" << setw(utils::MAXLENGTH16BYTES) << "N/A";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1352,9 +1352,9 @@ extern "C"
|
|||||||
{
|
{
|
||||||
if (static_cast<unsigned __int128>(partIt->second.bigMin) == ubigMaxLimit
|
if (static_cast<unsigned __int128>(partIt->second.bigMin) == ubigMaxLimit
|
||||||
&& static_cast<uint64_t>(partIt->second.bigMax) == ubigMinLimit)
|
&& static_cast<uint64_t>(partIt->second.bigMax) == ubigMinLimit)
|
||||||
output << setw(42) << "Empty/Null" << setw(42) << "Empty/Null";
|
output << setw(utils::MAXLENGTH16BYTES) << "Empty/Null" << setw(utils::MAXLENGTH16BYTES) << "Empty/Null";
|
||||||
else
|
else
|
||||||
output << setw(42) << format(partIt->second.bigMin, ct) << setw(42) << format(partIt->second.bigMax, ct);
|
output << setw(utils::MAXLENGTH16BYTES) << format(partIt->second.bigMin, ct) << setw(utils::MAXLENGTH16BYTES) << format(partIt->second.bigMax, ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1369,9 +1369,9 @@ extern "C"
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (partIt->second.bigMin == bigMaxLimit && partIt->second.bigMax == bigMinLimit)
|
if (partIt->second.bigMin == bigMaxLimit && partIt->second.bigMax == bigMinLimit)
|
||||||
output << setw(42) << "Empty/Null" << setw(42) << "Empty/Null";
|
output << setw(utils::MAXLENGTH16BYTES) << "Empty/Null" << setw(utils::MAXLENGTH16BYTES) << "Empty/Null";
|
||||||
else
|
else
|
||||||
output << setw(42) << format(partIt->second.bigMin, ct) << setw(42) << format(partIt->second.bigMax, ct);
|
output << setw(utils::MAXLENGTH16BYTES) << format(partIt->second.bigMin, ct) << setw(utils::MAXLENGTH16BYTES) << format(partIt->second.bigMax, ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2308,8 +2308,8 @@ extern "C"
|
|||||||
{
|
{
|
||||||
output.setf(ios::left, ios::adjustfield);
|
output.setf(ios::left, ios::adjustfield);
|
||||||
output << setw(10) << "Part#"
|
output << setw(10) << "Part#"
|
||||||
<< setw(42) << "Min"
|
<< setw(utils::MAXLENGTH16BYTES) << "Min"
|
||||||
<< setw(42) << "Max" << "Status";
|
<< setw(utils::MAXLENGTH16BYTES) << "Max" << "Status";
|
||||||
}
|
}
|
||||||
|
|
||||||
noPartFound = false;
|
noPartFound = false;
|
||||||
@ -2321,23 +2321,23 @@ extern "C"
|
|||||||
|
|
||||||
if (mapit->second.status & CPINVALID)
|
if (mapit->second.status & CPINVALID)
|
||||||
{
|
{
|
||||||
output << setw(42) << "N/A" << setw(42) << "N/A";
|
output << setw(utils::MAXLENGTH16BYTES) << "N/A" << setw(utils::MAXLENGTH16BYTES) << "N/A";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ((isUnsigned(ct.colDataType)))
|
if ((isUnsigned(ct.colDataType)))
|
||||||
{
|
{
|
||||||
if (static_cast<uint128_t>(mapit->second.bigMin) > static_cast<uint128_t>(mapit->second.bigMax))
|
if (static_cast<uint128_t>(mapit->second.bigMin) > static_cast<uint128_t>(mapit->second.bigMax))
|
||||||
output << setw(42) << "Empty/Null" << setw(42) << "Empty/Null";
|
output << setw(utils::MAXLENGTH16BYTES) << "Empty/Null" << setw(utils::MAXLENGTH16BYTES) << "Empty/Null";
|
||||||
else
|
else
|
||||||
output << setw(42) << format(mapit->second.bigMin, ct) << setw(42) << format(mapit->second.bigMax, ct);
|
output << setw(utils::MAXLENGTH16BYTES) << format(mapit->second.bigMin, ct) << setw(utils::MAXLENGTH16BYTES) << format(mapit->second.bigMax, ct);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (mapit->second.bigMin > mapit->second.bigMax)
|
if (mapit->second.bigMin > mapit->second.bigMax)
|
||||||
output << setw(42) << "Empty/Null" << setw(42) << "Empty/Null";
|
output << setw(utils::MAXLENGTH16BYTES) << "Empty/Null" << setw(utils::MAXLENGTH16BYTES) << "Empty/Null";
|
||||||
else
|
else
|
||||||
output << setw(42) << format(mapit->second.bigMin, ct) << setw(42) << format(mapit->second.bigMax, ct);
|
output << setw(utils::MAXLENGTH16BYTES) << format(mapit->second.bigMin, ct) << setw(utils::MAXLENGTH16BYTES) << format(mapit->second.bigMax, ct);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,25 +82,25 @@ static int generate_result(BRM::OID_t oid, BRM::DBRM* emp, TABLE* table, THD* th
|
|||||||
|
|
||||||
if (iter->colWid != datatypes::MAXDECIMALWIDTH)
|
if (iter->colWid != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
if (iter->partition.cprange.lo_val == std::numeric_limits<int64_t>::max() ||
|
if (iter->partition.cprange.loVal == std::numeric_limits<int64_t>::max() ||
|
||||||
iter->partition.cprange.lo_val <= (std::numeric_limits<int64_t>::min() + 1))
|
iter->partition.cprange.loVal <= (std::numeric_limits<int64_t>::min() + 1))
|
||||||
{
|
{
|
||||||
table->field[4]->set_null();
|
table->field[4]->set_null();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
table->field[4]->set_notnull();
|
table->field[4]->set_notnull();
|
||||||
table->field[4]->store(iter->partition.cprange.lo_val);
|
table->field[4]->store(iter->partition.cprange.loVal);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iter->partition.cprange.hi_val <= (std::numeric_limits<int64_t>::min() + 1))
|
if (iter->partition.cprange.hiVal <= (std::numeric_limits<int64_t>::min() + 1))
|
||||||
{
|
{
|
||||||
table->field[5]->set_null();
|
table->field[5]->set_null();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
table->field[5]->set_notnull();
|
table->field[5]->set_notnull();
|
||||||
table->field[5]->store(iter->partition.cprange.hi_val);
|
table->field[5]->store(iter->partition.cprange.hiVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -349,8 +349,8 @@ int dumpone(OID_t oid, unsigned int sortOrder)
|
|||||||
|
|
||||||
if (iter->colWid != datatypes::MAXDECIMALWIDTH)
|
if (iter->colWid != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
max = iter->partition.cprange.hi_val;
|
max = iter->partition.cprange.hiVal;
|
||||||
min = iter->partition.cprange.lo_val;
|
min = iter->partition.cprange.loVal;
|
||||||
|
|
||||||
cout << iter->range.start << " - " <<
|
cout << iter->range.start << " - " <<
|
||||||
(iter->range.start + lbidRangeSize - 1) <<
|
(iter->range.start + lbidRangeSize - 1) <<
|
||||||
|
@ -56,6 +56,7 @@ namespace bi = boost::interprocess;
|
|||||||
#include "blocksize.h"
|
#include "blocksize.h"
|
||||||
#include "dataconvert.h"
|
#include "dataconvert.h"
|
||||||
#include "widedecimalutils.h"
|
#include "widedecimalutils.h"
|
||||||
|
#include "mcs_decimal.h"
|
||||||
#include "oamcache.h"
|
#include "oamcache.h"
|
||||||
#include "IDBDataFile.h"
|
#include "IDBDataFile.h"
|
||||||
#include "IDBPolicy.h"
|
#include "IDBPolicy.h"
|
||||||
@ -118,8 +119,6 @@ namespace BRM
|
|||||||
|
|
||||||
EMCasualPartition_struct::EMCasualPartition_struct()
|
EMCasualPartition_struct::EMCasualPartition_struct()
|
||||||
{
|
{
|
||||||
lo_val = numeric_limits<int64_t>::max();
|
|
||||||
hi_val = numeric_limits<int64_t>::min();
|
|
||||||
utils::int128Max(bigLoVal);
|
utils::int128Max(bigLoVal);
|
||||||
utils::int128Min(bigHiVal);
|
utils::int128Min(bigHiVal);
|
||||||
sequenceNum = 0;
|
sequenceNum = 0;
|
||||||
@ -128,8 +127,8 @@ EMCasualPartition_struct::EMCasualPartition_struct()
|
|||||||
|
|
||||||
EMCasualPartition_struct::EMCasualPartition_struct(const int64_t lo, const int64_t hi, const int32_t seqNum)
|
EMCasualPartition_struct::EMCasualPartition_struct(const int64_t lo, const int64_t hi, const int32_t seqNum)
|
||||||
{
|
{
|
||||||
lo_val = lo;
|
loVal = lo;
|
||||||
hi_val = hi;
|
hiVal = hi;
|
||||||
sequenceNum = seqNum;
|
sequenceNum = seqNum;
|
||||||
isValid = CP_INVALID;
|
isValid = CP_INVALID;
|
||||||
}
|
}
|
||||||
@ -144,8 +143,6 @@ EMCasualPartition_struct::EMCasualPartition_struct(const __int128 bigLo, const _
|
|||||||
|
|
||||||
EMCasualPartition_struct::EMCasualPartition_struct(const EMCasualPartition_struct& em)
|
EMCasualPartition_struct::EMCasualPartition_struct(const EMCasualPartition_struct& em)
|
||||||
{
|
{
|
||||||
lo_val = em.lo_val;
|
|
||||||
hi_val = em.hi_val;
|
|
||||||
bigLoVal = em.bigLoVal;
|
bigLoVal = em.bigLoVal;
|
||||||
bigHiVal = em.bigHiVal;
|
bigHiVal = em.bigHiVal;
|
||||||
sequenceNum = em.sequenceNum;
|
sequenceNum = em.sequenceNum;
|
||||||
@ -154,8 +151,6 @@ EMCasualPartition_struct::EMCasualPartition_struct(const EMCasualPartition_struc
|
|||||||
|
|
||||||
EMCasualPartition_struct& EMCasualPartition_struct::operator= (const EMCasualPartition_struct& em)
|
EMCasualPartition_struct& EMCasualPartition_struct::operator= (const EMCasualPartition_struct& em)
|
||||||
{
|
{
|
||||||
lo_val = em.lo_val;
|
|
||||||
hi_val = em.hi_val;
|
|
||||||
bigLoVal = em.bigLoVal;
|
bigLoVal = em.bigLoVal;
|
||||||
bigHiVal = em.bigHiVal;
|
bigHiVal = em.bigHiVal;
|
||||||
sequenceNum = em.sequenceNum;
|
sequenceNum = em.sequenceNum;
|
||||||
@ -353,17 +348,21 @@ int ExtentMap::_markInvalid(const LBID_t lbid, const execplan::CalpontSystemCata
|
|||||||
|
|
||||||
if (isUnsigned(colDataType))
|
if (isUnsigned(colDataType))
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.lo_val = numeric_limits<uint64_t>::max();
|
|
||||||
fExtentMap[i].partition.cprange.hi_val = 0;
|
|
||||||
fExtentMap[i].partition.cprange.bigLoVal = -1;
|
fExtentMap[i].partition.cprange.bigLoVal = -1;
|
||||||
fExtentMap[i].partition.cprange.bigHiVal = 0;
|
fExtentMap[i].partition.cprange.bigHiVal = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
if (fExtentMap[i].colWid != datatypes::MAXDECIMALWIDTH)
|
||||||
fExtentMap[i].partition.cprange.hi_val = numeric_limits<int64_t>::min();
|
{
|
||||||
utils::int128Max(fExtentMap[i].partition.cprange.bigLoVal);
|
fExtentMap[i].partition.cprange.loVal = numeric_limits<int64_t>::max();
|
||||||
utils::int128Min(fExtentMap[i].partition.cprange.bigHiVal);
|
fExtentMap[i].partition.cprange.hiVal = numeric_limits<int64_t>::min();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
utils::int128Max(fExtentMap[i].partition.cprange.bigLoVal);
|
||||||
|
utils::int128Min(fExtentMap[i].partition.cprange.bigHiVal);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
||||||
@ -372,8 +371,8 @@ int ExtentMap::_markInvalid(const LBID_t lbid, const execplan::CalpontSystemCata
|
|||||||
os << "ExtentMap::_markInvalid(): casual partitioning update: firstLBID=" <<
|
os << "ExtentMap::_markInvalid(): casual partitioning update: firstLBID=" <<
|
||||||
fExtentMap[i].range.start << " lastLBID=" << fExtentMap[i].range.start +
|
fExtentMap[i].range.start << " lastLBID=" << fExtentMap[i].range.start +
|
||||||
fExtentMap[i].range.size * 1024 - 1 << " OID=" << fExtentMap[i].fileID <<
|
fExtentMap[i].range.size * 1024 - 1 << " OID=" << fExtentMap[i].fileID <<
|
||||||
" min=" << fExtentMap[i].partition.cprange.lo_val <<
|
" min=" << fExtentMap[i].partition.cprange.loVal <<
|
||||||
" max=" << fExtentMap[i].partition.cprange.hi_val <<
|
" max=" << fExtentMap[i].partition.cprange.hiVal <<
|
||||||
"seq=" << fExtentMap[i].partition.cprange.sequenceNum;
|
"seq=" << fExtentMap[i].partition.cprange.sequenceNum;
|
||||||
log(os.str(), logging::LOG_TYPE_DEBUG);
|
log(os.str(), logging::LOG_TYPE_DEBUG);
|
||||||
#endif
|
#endif
|
||||||
@ -472,7 +471,7 @@ int ExtentMap::markInvalid(const vector<LBID_t>& lbids,
|
|||||||
/**
|
/**
|
||||||
* @brief set the max/min values for the extent if the seqNum matches the extents sequenceNum
|
* @brief set the max/min values for the extent if the seqNum matches the extents sequenceNum
|
||||||
*
|
*
|
||||||
* reset the lbid's hi_val to max and lo_val to min
|
* reset the lbid's hiVal to max and loVal to min
|
||||||
* the seqNum matches the ExtentMap.sequenceNum. Then increments
|
* the seqNum matches the ExtentMap.sequenceNum. Then increments
|
||||||
* the current sequenceNum value by 1. If the sequenceNum does not
|
* the current sequenceNum value by 1. If the sequenceNum does not
|
||||||
* match the seqNum value do not update the lbid's max/min values
|
* match the seqNum value do not update the lbid's max/min values
|
||||||
@ -543,8 +542,8 @@ int ExtentMap::setMaxMin(const LBID_t lbid,
|
|||||||
if (curSequence == seqNum)
|
if (curSequence == seqNum)
|
||||||
{
|
{
|
||||||
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
||||||
fExtentMap[i].partition.cprange.hi_val = max;
|
fExtentMap[i].partition.cprange.hiVal = max;
|
||||||
fExtentMap[i].partition.cprange.lo_val = min;
|
fExtentMap[i].partition.cprange.loVal = min;
|
||||||
fExtentMap[i].partition.cprange.isValid = CP_VALID;
|
fExtentMap[i].partition.cprange.isValid = CP_VALID;
|
||||||
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
||||||
return 0;
|
return 0;
|
||||||
@ -554,7 +553,7 @@ int ExtentMap::setMaxMin(const LBID_t lbid,
|
|||||||
else if (seqNum == -1)
|
else if (seqNum == -1)
|
||||||
{
|
{
|
||||||
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
||||||
// We set hi_val and lo_val to correct values for signed or unsigned
|
// We set hiVal and loVal to correct values for signed or unsigned
|
||||||
// during the markinvalid step, which sets the invalid variable to CP_UPDATING.
|
// during the markinvalid step, which sets the invalid variable to CP_UPDATING.
|
||||||
// During this step (seqNum == -1), the min and max passed in are not reliable
|
// During this step (seqNum == -1), the min and max passed in are not reliable
|
||||||
// and should not be used.
|
// and should not be used.
|
||||||
@ -655,8 +654,8 @@ void ExtentMap::setExtentsMaxMin(const CPMaxMinMap_t& cpMap, bool firstNode, boo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.hi_val = it->second.max;
|
fExtentMap[i].partition.cprange.hiVal = it->second.max;
|
||||||
fExtentMap[i].partition.cprange.lo_val = it->second.min;
|
fExtentMap[i].partition.cprange.loVal = it->second.min;
|
||||||
}
|
}
|
||||||
fExtentMap[i].partition.cprange.isValid = CP_VALID;
|
fExtentMap[i].partition.cprange.isValid = CP_VALID;
|
||||||
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
||||||
@ -681,7 +680,7 @@ void ExtentMap::setExtentsMaxMin(const CPMaxMinMap_t& cpMap, bool firstNode, boo
|
|||||||
else if (it->second.seqNum == -1)
|
else if (it->second.seqNum == -1)
|
||||||
{
|
{
|
||||||
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
makeUndoRecord(&fExtentMap[i], sizeof(struct EMEntry));
|
||||||
// We set hi_val and lo_val to correct values for signed or unsigned
|
// We set hiVal and loVal to correct values for signed or unsigned
|
||||||
// during the markinvalid step, which sets the invalid variable to CP_UPDATING.
|
// during the markinvalid step, which sets the invalid variable to CP_UPDATING.
|
||||||
// During this step (seqNum == -1), the min and max passed in are not reliable
|
// During this step (seqNum == -1), the min and max passed in are not reliable
|
||||||
// and should not be used.
|
// and should not be used.
|
||||||
@ -700,8 +699,8 @@ void ExtentMap::setExtentsMaxMin(const CPMaxMinMap_t& cpMap, bool firstNode, boo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.hi_val = it->second.max;
|
fExtentMap[i].partition.cprange.hiVal = it->second.max;
|
||||||
fExtentMap[i].partition.cprange.lo_val = it->second.min;
|
fExtentMap[i].partition.cprange.loVal = it->second.min;
|
||||||
}
|
}
|
||||||
fExtentMap[i].partition.cprange.isValid = CP_INVALID;
|
fExtentMap[i].partition.cprange.isValid = CP_INVALID;
|
||||||
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
incSeqNum(fExtentMap[i].partition.cprange.sequenceNum);
|
||||||
@ -816,8 +815,8 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
os << "ExtentMap::mergeExtentsMaxMin(): casual partitioning update: firstLBID=" <<
|
os << "ExtentMap::mergeExtentsMaxMin(): casual partitioning update: firstLBID=" <<
|
||||||
fExtentMap[i].range.start << " lastLBID=" << fExtentMap[i].range.start +
|
fExtentMap[i].range.start << " lastLBID=" << fExtentMap[i].range.start +
|
||||||
fExtentMap[i].range.size * 1024 - 1 << " OID=" << fExtentMap[i].fileID <<
|
fExtentMap[i].range.size * 1024 - 1 << " OID=" << fExtentMap[i].fileID <<
|
||||||
" hi_val=" << fExtentMap[i].partition.cprange.hi_val <<
|
" hiVal=" << fExtentMap[i].partition.cprange.hiVal <<
|
||||||
" lo_val=" << fExtentMap[i].partition.cprange.lo_val <<
|
" loVal=" << fExtentMap[i].partition.cprange.loVal <<
|
||||||
" min=" << it->second.min << " max=" << it->second.max <<
|
" min=" << it->second.min << " max=" << it->second.max <<
|
||||||
" seq=" << it->second.seqNum;
|
" seq=" << it->second.seqNum;
|
||||||
log(os.str(), logging::LOG_TYPE_DEBUG);
|
log(os.str(), logging::LOG_TYPE_DEBUG);
|
||||||
@ -845,8 +844,8 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
// min/max needs to be set instead of merged.
|
// min/max needs to be set instead of merged.
|
||||||
|
|
||||||
if (isValidCPRange(
|
if (isValidCPRange(
|
||||||
!isBinaryColumn ? fExtentMap[i].partition.cprange.hi_val : fExtentMap[i].partition.cprange.bigHiVal,
|
!isBinaryColumn ? fExtentMap[i].partition.cprange.hiVal : fExtentMap[i].partition.cprange.bigHiVal,
|
||||||
!isBinaryColumn ? fExtentMap[i].partition.cprange.lo_val : fExtentMap[i].partition.cprange.bigLoVal,
|
!isBinaryColumn ? fExtentMap[i].partition.cprange.loVal : fExtentMap[i].partition.cprange.bigLoVal,
|
||||||
it->second.type))
|
it->second.type))
|
||||||
{
|
{
|
||||||
// Swap byte order to do binary string comparison
|
// Swap byte order to do binary string comparison
|
||||||
@ -861,18 +860,18 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
int64_t oldMinVal =
|
int64_t oldMinVal =
|
||||||
static_cast<int64_t>( uint64ToStr(
|
static_cast<int64_t>( uint64ToStr(
|
||||||
static_cast<uint64_t>(
|
static_cast<uint64_t>(
|
||||||
fExtentMap[i].partition.cprange.lo_val)) );
|
fExtentMap[i].partition.cprange.loVal)) );
|
||||||
int64_t oldMaxVal =
|
int64_t oldMaxVal =
|
||||||
static_cast<int64_t>( uint64ToStr(
|
static_cast<int64_t>( uint64ToStr(
|
||||||
static_cast<uint64_t>(
|
static_cast<uint64_t>(
|
||||||
fExtentMap[i].partition.cprange.hi_val)) );
|
fExtentMap[i].partition.cprange.hiVal)) );
|
||||||
|
|
||||||
if (newMinVal < oldMinVal)
|
if (newMinVal < oldMinVal)
|
||||||
fExtentMap[i].partition.cprange.lo_val =
|
fExtentMap[i].partition.cprange.loVal =
|
||||||
it->second.min;
|
it->second.min;
|
||||||
|
|
||||||
if (newMaxVal > oldMaxVal)
|
if (newMaxVal > oldMaxVal)
|
||||||
fExtentMap[i].partition.cprange.hi_val =
|
fExtentMap[i].partition.cprange.hiVal =
|
||||||
it->second.max;
|
it->second.max;
|
||||||
}
|
}
|
||||||
else if (isUnsigned(it->second.type))
|
else if (isUnsigned(it->second.type))
|
||||||
@ -880,16 +879,16 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
if (!isBinaryColumn)
|
if (!isBinaryColumn)
|
||||||
{
|
{
|
||||||
if (static_cast<uint64_t>(it->second.min) <
|
if (static_cast<uint64_t>(it->second.min) <
|
||||||
static_cast<uint64_t>(fExtentMap[i].partition.cprange.lo_val))
|
static_cast<uint64_t>(fExtentMap[i].partition.cprange.loVal))
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.lo_val =
|
fExtentMap[i].partition.cprange.loVal =
|
||||||
it->second.min;
|
it->second.min;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static_cast<uint64_t>(it->second.max) >
|
if (static_cast<uint64_t>(it->second.max) >
|
||||||
static_cast<uint64_t>(fExtentMap[i].partition.cprange.hi_val))
|
static_cast<uint64_t>(fExtentMap[i].partition.cprange.hiVal))
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.hi_val =
|
fExtentMap[i].partition.cprange.hiVal =
|
||||||
it->second.max;
|
it->second.max;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -915,13 +914,13 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
if (!isBinaryColumn)
|
if (!isBinaryColumn)
|
||||||
{
|
{
|
||||||
if (it->second.min <
|
if (it->second.min <
|
||||||
fExtentMap[i].partition.cprange.lo_val)
|
fExtentMap[i].partition.cprange.loVal)
|
||||||
fExtentMap[i].partition.cprange.lo_val =
|
fExtentMap[i].partition.cprange.loVal =
|
||||||
it->second.min;
|
it->second.min;
|
||||||
|
|
||||||
if (it->second.max >
|
if (it->second.max >
|
||||||
fExtentMap[i].partition.cprange.hi_val)
|
fExtentMap[i].partition.cprange.hiVal)
|
||||||
fExtentMap[i].partition.cprange.hi_val =
|
fExtentMap[i].partition.cprange.hiVal =
|
||||||
it->second.max;
|
it->second.max;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -942,9 +941,9 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
{
|
{
|
||||||
if (!isBinaryColumn)
|
if (!isBinaryColumn)
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.lo_val =
|
fExtentMap[i].partition.cprange.loVal =
|
||||||
it->second.min;
|
it->second.min;
|
||||||
fExtentMap[i].partition.cprange.hi_val =
|
fExtentMap[i].partition.cprange.hiVal =
|
||||||
it->second.max;
|
it->second.max;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -988,9 +987,9 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
{
|
{
|
||||||
if (!isBinaryColumn)
|
if (!isBinaryColumn)
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.lo_val =
|
fExtentMap[i].partition.cprange.loVal =
|
||||||
it->second.min;
|
it->second.min;
|
||||||
fExtentMap[i].partition.cprange.hi_val =
|
fExtentMap[i].partition.cprange.hiVal =
|
||||||
it->second.max;
|
it->second.max;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1086,7 +1085,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief retrieve the hi_val and lo_val or sequenceNum of the extent containing the LBID lbid.
|
* @brief retrieve the hiVal and loVal or sequenceNum of the extent containing the LBID lbid.
|
||||||
*
|
*
|
||||||
* For the extent containing the LBID lbid, return the max/min values if the extent range values
|
* For the extent containing the LBID lbid, return the max/min values if the extent range values
|
||||||
* are valid and a -1 in the seqNum parameter. If the range values are flaged as invalid
|
* are valid and a -1 in the seqNum parameter. If the range values are flaged as invalid
|
||||||
@ -1156,8 +1155,8 @@ int ExtentMap::getMaxMin(const LBID_t lbid,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
max = fExtentMap[i].partition.cprange.hi_val;
|
max = fExtentMap[i].partition.cprange.hiVal;
|
||||||
min = fExtentMap[i].partition.cprange.lo_val;
|
min = fExtentMap[i].partition.cprange.loVal;
|
||||||
}
|
}
|
||||||
seqNum = fExtentMap[i].partition.cprange.sequenceNum;
|
seqNum = fExtentMap[i].partition.cprange.sequenceNum;
|
||||||
isValid = fExtentMap[i].partition.cprange.isValid;
|
isValid = fExtentMap[i].partition.cprange.isValid;
|
||||||
@ -1369,12 +1368,10 @@ void ExtentMap::loadVersion4or5(IDBDataFile* in, bool upgradeV4ToV5)
|
|||||||
fExtentMap[i].dbRoot = emEntryV4.dbRoot;
|
fExtentMap[i].dbRoot = emEntryV4.dbRoot;
|
||||||
fExtentMap[i].colWid = emEntryV4.colWid;
|
fExtentMap[i].colWid = emEntryV4.colWid;
|
||||||
fExtentMap[i].status = emEntryV4.status;
|
fExtentMap[i].status = emEntryV4.status;
|
||||||
fExtentMap[i].partition.cprange.hi_val = emEntryV4.partition.cprange.hi_val;
|
fExtentMap[i].partition.cprange.hiVal = emEntryV4.partition.cprange.hi_val;
|
||||||
fExtentMap[i].partition.cprange.lo_val = emEntryV4.partition.cprange.lo_val;
|
fExtentMap[i].partition.cprange.loVal = emEntryV4.partition.cprange.lo_val;
|
||||||
fExtentMap[i].partition.cprange.sequenceNum = emEntryV4.partition.cprange.sequenceNum;
|
fExtentMap[i].partition.cprange.sequenceNum = emEntryV4.partition.cprange.sequenceNum;
|
||||||
fExtentMap[i].partition.cprange.isValid = emEntryV4.partition.cprange.isValid;
|
fExtentMap[i].partition.cprange.isValid = emEntryV4.partition.cprange.isValid;
|
||||||
utils::int128Max(fExtentMap[i].partition.cprange.bigLoVal);
|
|
||||||
utils::int128Min(fExtentMap[i].partition.cprange.bigHiVal);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout<<emNumElements<<" extents successfully upgraded"<<std::endl;
|
std::cout<<emNumElements<<" extents successfully upgraded"<<std::endl;
|
||||||
@ -1408,8 +1405,8 @@ void ExtentMap::loadVersion4or5(IDBDataFile* in, bool upgradeV4ToV5)
|
|||||||
<< '\t' << emSrc[i].segmentNum
|
<< '\t' << emSrc[i].segmentNum
|
||||||
<< '\t' << emSrc[i].dbRoot
|
<< '\t' << emSrc[i].dbRoot
|
||||||
<< '\t' << emSrc[i].status
|
<< '\t' << emSrc[i].status
|
||||||
<< '\t' << emSrc[i].partition.cprange.hi_val
|
<< '\t' << emSrc[i].partition.cprange.hiVal
|
||||||
<< '\t' << emSrc[i].partition.cprange.lo_val
|
<< '\t' << emSrc[i].partition.cprange.loVal
|
||||||
<< '\t' << emSrc[i].partition.cprange.sequenceNum
|
<< '\t' << emSrc[i].partition.cprange.sequenceNum
|
||||||
<< '\t' << (int)(emSrc[i].partition.cprange.isValid)
|
<< '\t' << (int)(emSrc[i].partition.cprange.isValid)
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -2763,10 +2760,10 @@ LBID_t ExtentMap::_createColumnExtent_DBroot(uint32_t size, int OID,
|
|||||||
|
|
||||||
if (isUnsigned(colDataType))
|
if (isUnsigned(colDataType))
|
||||||
{
|
{
|
||||||
if (colWidth <= 8)
|
if (colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
e->partition.cprange.lo_val = numeric_limits<uint64_t>::max();
|
e->partition.cprange.loVal = numeric_limits<uint64_t>::max();
|
||||||
e->partition.cprange.hi_val = 0;
|
e->partition.cprange.hiVal = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2776,10 +2773,10 @@ LBID_t ExtentMap::_createColumnExtent_DBroot(uint32_t size, int OID,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (colWidth <= 8)
|
if (colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
e->partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
e->partition.cprange.loVal = numeric_limits<int64_t>::max();
|
||||||
e->partition.cprange.hi_val = numeric_limits<int64_t>::min();
|
e->partition.cprange.hiVal = numeric_limits<int64_t>::min();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2974,10 +2971,10 @@ LBID_t ExtentMap::_createColumnExtentExactFile(uint32_t size, int OID,
|
|||||||
|
|
||||||
if (isUnsigned(colDataType))
|
if (isUnsigned(colDataType))
|
||||||
{
|
{
|
||||||
if (colWidth <= 8)
|
if (colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
e->partition.cprange.lo_val = numeric_limits<uint64_t>::max();
|
e->partition.cprange.loVal = numeric_limits<uint64_t>::max();
|
||||||
e->partition.cprange.hi_val = 0;
|
e->partition.cprange.hiVal = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2987,10 +2984,10 @@ LBID_t ExtentMap::_createColumnExtentExactFile(uint32_t size, int OID,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (colWidth <= 8)
|
if (colWidth != datatypes::MAXDECIMALWIDTH)
|
||||||
{
|
{
|
||||||
e->partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
e->partition.cprange.loVal = numeric_limits<int64_t>::max();
|
||||||
e->partition.cprange.hi_val = numeric_limits<int64_t>::min();
|
e->partition.cprange.hiVal = numeric_limits<int64_t>::min();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -3179,8 +3176,6 @@ LBID_t ExtentMap::_createDictStoreExtent(uint32_t size, int OID,
|
|||||||
e->range.size = size;
|
e->range.size = size;
|
||||||
e->fileID = OID;
|
e->fileID = OID;
|
||||||
e->status = EXTENTUNAVAILABLE;// @bug 1911 mark extent as in process
|
e->status = EXTENTUNAVAILABLE;// @bug 1911 mark extent as in process
|
||||||
e->partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
|
||||||
e->partition.cprange.hi_val = numeric_limits<int64_t>::min();
|
|
||||||
utils::int128Max(e->partition.cprange.bigLoVal);
|
utils::int128Max(e->partition.cprange.bigLoVal);
|
||||||
utils::int128Min(e->partition.cprange.bigHiVal);
|
utils::int128Min(e->partition.cprange.bigHiVal);
|
||||||
e->partition.cprange.sequenceNum = 0;
|
e->partition.cprange.sequenceNum = 0;
|
||||||
@ -3271,8 +3266,8 @@ void ExtentMap::printEM(const EMEntry& em) const
|
|||||||
<< (long) em.range.size << " OID "
|
<< (long) em.range.size << " OID "
|
||||||
<< (long) em.fileID << " offset "
|
<< (long) em.fileID << " offset "
|
||||||
<< (long) em.blockOffset
|
<< (long) em.blockOffset
|
||||||
<< " LV " << em.partition.cprange.lo_val
|
<< " LV " << em.partition.cprange.loVal
|
||||||
<< " HV " << em.partition.cprange.hi_val;
|
<< " HV " << em.partition.cprange.hiVal;
|
||||||
cout << endl;
|
cout << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4668,8 +4663,8 @@ void ExtentMap::setLocalHWM(int OID, uint32_t partitionNum,
|
|||||||
os << "ExtentMap::setLocalHWM(): firstLBID=" << fExtentMap[lastExtentIndex].range.start <<
|
os << "ExtentMap::setLocalHWM(): firstLBID=" << fExtentMap[lastExtentIndex].range.start <<
|
||||||
" lastLBID=" << fExtentMap[lastExtentIndex].range.start +
|
" lastLBID=" << fExtentMap[lastExtentIndex].range.start +
|
||||||
fExtentMap[lastExtentIndex].range.size * 1024 - 1 << " newHWM=" << fExtentMap[lastExtentIndex].HWM
|
fExtentMap[lastExtentIndex].range.size * 1024 - 1 << " newHWM=" << fExtentMap[lastExtentIndex].HWM
|
||||||
<< " min=" << fExtentMap[lastExtentIndex].partition.cprange.lo_val << " max=" <<
|
<< " min=" << fExtentMap[lastExtentIndex].partition.cprange.loVal << " max=" <<
|
||||||
fExtentMap[lastExtentIndex].partition.cprange.hi_val << " seq=" <<
|
fExtentMap[lastExtentIndex].partition.cprange.hiVal << " seq=" <<
|
||||||
fExtentMap[lastExtentIndex].partition.cprange.sequenceNum << " status=";
|
fExtentMap[lastExtentIndex].partition.cprange.sequenceNum << " status=";
|
||||||
|
|
||||||
switch (fExtentMap[lastExtentIndex].partition.cprange.isValid)
|
switch (fExtentMap[lastExtentIndex].partition.cprange.isValid)
|
||||||
@ -4830,8 +4825,8 @@ void ExtentMap::getExtents_dbroot(int OID, vector<struct EMEntry>& entries, cons
|
|||||||
fakeEntry.dbRoot = 1;
|
fakeEntry.dbRoot = 1;
|
||||||
fakeEntry.colWid = 4;
|
fakeEntry.colWid = 4;
|
||||||
fakeEntry.status = EXTENTAVAILABLE;
|
fakeEntry.status = EXTENTAVAILABLE;
|
||||||
fakeEntry.partition.cprange.hi_val = numeric_limits<int64_t>::min() + 2;
|
fakeEntry.partition.cprange.hiVal = numeric_limits<int64_t>::min() + 2;
|
||||||
fakeEntry.partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
fakeEntry.partition.cprange.loVal = numeric_limits<int64_t>::max();
|
||||||
fakeEntry.partition.cprange.sequenceNum = 0;
|
fakeEntry.partition.cprange.sequenceNum = 0;
|
||||||
fakeEntry.partition.cprange.isValid = CP_INVALID;
|
fakeEntry.partition.cprange.isValid = CP_INVALID;
|
||||||
entries.push_back(fakeEntry);
|
entries.push_back(fakeEntry);
|
||||||
@ -5475,8 +5470,8 @@ void ExtentMap::lookup(OID_t OID, LBIDRange_v& ranges)
|
|||||||
fakeEntry.dbRoot = 1;
|
fakeEntry.dbRoot = 1;
|
||||||
fakeEntry.colWid = 4;
|
fakeEntry.colWid = 4;
|
||||||
fakeEntry.status = EXTENTAVAILABLE;
|
fakeEntry.status = EXTENTAVAILABLE;
|
||||||
fakeEntry.partition.cprange.hi_val = numeric_limits<int64_t>::min() + 2;
|
fakeEntry.partition.cprange.hiVal = numeric_limits<int64_t>::min() + 2;
|
||||||
fakeEntry.partition.cprange.lo_val = numeric_limits<int64_t>::max();
|
fakeEntry.partition.cprange.loVal = numeric_limits<int64_t>::max();
|
||||||
fakeEntry.partition.cprange.sequenceNum = 0;
|
fakeEntry.partition.cprange.sequenceNum = 0;
|
||||||
fakeEntry.partition.cprange.isValid = CP_INVALID;
|
fakeEntry.partition.cprange.isValid = CP_INVALID;
|
||||||
#endif
|
#endif
|
||||||
@ -6011,8 +6006,8 @@ void ExtentMap::dumpTo(ostream& os)
|
|||||||
<< fExtentMap[i].dbRoot << '|'
|
<< fExtentMap[i].dbRoot << '|'
|
||||||
<< fExtentMap[i].colWid << '|'
|
<< fExtentMap[i].colWid << '|'
|
||||||
<< fExtentMap[i].status << '|'
|
<< fExtentMap[i].status << '|'
|
||||||
<< fExtentMap[i].partition.cprange.hi_val << '|'
|
<< fExtentMap[i].partition.cprange.hiVal << '|'
|
||||||
<< fExtentMap[i].partition.cprange.lo_val << '|'
|
<< fExtentMap[i].partition.cprange.loVal << '|'
|
||||||
<< fExtentMap[i].partition.cprange.sequenceNum << '|'
|
<< fExtentMap[i].partition.cprange.sequenceNum << '|'
|
||||||
<< (int)fExtentMap[i].partition.cprange.isValid << '|'
|
<< (int)fExtentMap[i].partition.cprange.isValid << '|'
|
||||||
<< endl;
|
<< endl;
|
||||||
|
@ -133,13 +133,11 @@ struct EMEntry_v4
|
|||||||
// and max values for casual partitioning.
|
// and max values for casual partitioning.
|
||||||
struct EMCasualPartition_struct
|
struct EMCasualPartition_struct
|
||||||
{
|
{
|
||||||
RangePartitionData_t hi_val; // This needs to be reinterpreted as unsigned for uint64_t column types.
|
|
||||||
RangePartitionData_t lo_val;
|
|
||||||
int32_t sequenceNum;
|
int32_t sequenceNum;
|
||||||
char isValid; //CP_INVALID - No min/max and no DML in progress. CP_UPDATING - Update in progress. CP_VALID- min/max is valid
|
char isValid; //CP_INVALID - No min/max and no DML in progress. CP_UPDATING - Update in progress. CP_VALID- min/max is valid
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigLoVal;
|
__int128 bigLoVal; // These need to be reinterpreted as unsigned for uint64_t/uint128_t column types.
|
||||||
int64_t loVal;
|
int64_t loVal;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
|
Reference in New Issue
Block a user