1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-12 05:01:56 +03:00

MCOL-641 1. Templatized convertValueNum() function.

2. Allocate int128_t buffers in batchprimitiveprocessor if
a query involves wide decimal columns.
This commit is contained in:
Gagan Goel
2020-03-10 19:41:25 -04:00
committed by Roman Nozdrin
parent 9b714274db
commit 62d0c82d75
23 changed files with 235 additions and 105 deletions

View File

@ -100,6 +100,7 @@ BatchPrimitiveProcessor::BatchPrimitiveProcessor() :
baseRid(0),
ridCount(0),
needStrValues(false),
hasWideDecimalType(false),
filterCount(0),
projectCount(0),
sendRidsAtDelivery(false),
@ -145,6 +146,7 @@ BatchPrimitiveProcessor::BatchPrimitiveProcessor(ByteStream& b, double prefetch,
baseRid(0),
ridCount(0),
needStrValues(false),
hasWideDecimalType(false),
filterCount(0),
projectCount(0),
sendRidsAtDelivery(false),
@ -218,6 +220,7 @@ void BatchPrimitiveProcessor::initBPP(ByteStream& bs)
{
uint32_t i;
uint8_t tmp8;
uint16_t tmp16;
Command::CommandType type;
bs.advance(sizeof(ISMPacketHeader)); // skip the header
@ -229,15 +232,16 @@ void BatchPrimitiveProcessor::initBPP(ByteStream& bs)
bs >> uniqueID;
bs >> versionInfo;
bs >> tmp8;
needStrValues = tmp8 & NEED_STR_VALUES;
gotAbsRids = tmp8 & GOT_ABS_RIDS;
gotValues = tmp8 & GOT_VALUES;
LBIDTrace = tmp8 & LBID_TRACE;
sendRidsAtDelivery = tmp8 & SEND_RIDS_AT_DELIVERY;
doJoin = tmp8 & HAS_JOINER;
hasRowGroup = tmp8 & HAS_ROWGROUP;
getTupleJoinRowGroupData = tmp8 & JOIN_ROWGROUP_DATA;
bs >> tmp16;
needStrValues = tmp16 & NEED_STR_VALUES;
gotAbsRids = tmp16 & GOT_ABS_RIDS;
gotValues = tmp16 & GOT_VALUES;
LBIDTrace = tmp16 & LBID_TRACE;
sendRidsAtDelivery = tmp16 & SEND_RIDS_AT_DELIVERY;
doJoin = tmp16 & HAS_JOINER;
hasRowGroup = tmp16 & HAS_ROWGROUP;
getTupleJoinRowGroupData = tmp16 & JOIN_ROWGROUP_DATA;
hasWideDecimalType = tmp16 & HAS_WIDE_DECIMAL;
// This used to signify that there was input row data from previous jobsteps, and
// it never quite worked right. No need to fix it or update it; all BPP's have started
@ -1019,6 +1023,8 @@ void BatchPrimitiveProcessor::initProcessor()
fFiltRidCount[i] = 0;
fFiltCmdRids[i].reset(new uint16_t[LOGICAL_BLOCK_RIDS]);
fFiltCmdValues[i].reset(new int64_t[LOGICAL_BLOCK_RIDS]);
if (hasWideDecimalType)
fFiltCmdBinaryValues[i].reset(new int128_t[LOGICAL_BLOCK_RIDS]);
if (filtOnString) fFiltStrValues[i].reset(new string[LOGICAL_BLOCK_RIDS]);
}
@ -1539,6 +1545,11 @@ void BatchPrimitiveProcessor::execute()
projectSteps[j]->projectIntoRowGroup(fe1Input, projectForFE1[j]);
for (j = 0; j < ridCount; j++, fe1In.nextRow())
// TODO MCOL-641
// WHERE clause on a numeric and a non-numeric column
// leads to this execution path:
// SELECT a, b from t1 where a!=b
// Here, a is e.g., decimal(38), b is varchar(15)
if (fe1->evaluate(&fe1In))
{
applyMapping(fe1ToProjection, fe1In, &fe1Out);
@ -2339,6 +2350,7 @@ SBPP BatchPrimitiveProcessor::duplicate()
bpp->stepID = stepID;
bpp->uniqueID = uniqueID;
bpp->needStrValues = needStrValues;
bpp->hasWideDecimalType = hasWideDecimalType;
bpp->gotAbsRids = gotAbsRids;
bpp->gotValues = gotValues;
bpp->LBIDTrace = LBIDTrace;