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
MCOL-641 Work of Ivan Zuniga on basic read and write support for Binary16
This commit is contained in:
committed by
Roman Nozdrin
parent
d943beb445
commit
32f6167067
@ -245,7 +245,7 @@ void ColumnCommand::issuePrimitive()
|
||||
bpp->pp.setParsedColumnFilter(parsedColumnFilter);
|
||||
else
|
||||
bpp->pp.setParsedColumnFilter(emptyFilter);
|
||||
|
||||
|
||||
bpp->pp.p_Col(primMsg, outMsg, bpp->outMsgSize, (unsigned int*)&resultSize);
|
||||
|
||||
/* Update CP data, the PseudoColumn code should always be !_isScan. Should be safe
|
||||
@ -273,6 +273,31 @@ void ColumnCommand::process_OT_BOTH()
|
||||
/* this is verbose and repetative to minimize the work per row */
|
||||
switch (colType.colWidth)
|
||||
{
|
||||
case 16:
|
||||
for (i = 0, pos = sizeof(NewColResultHeader); i < outMsg->NVALS; ++i)
|
||||
{
|
||||
if (makeAbsRids)
|
||||
bpp->absRids[i] = *((uint16_t*) &bpp->outputMsg[pos]) + bpp->baseRid;
|
||||
|
||||
bpp->relRids[i] = *((uint16_t*) &bpp->outputMsg[pos]);
|
||||
pos += 2;
|
||||
// values[i] is 8 Bytes wide so coping the pointer to bpp->outputMsg[pos] and crossing fingers
|
||||
// I dont know the liveness of bpp->outputMsg but also I dont know if there is other memory area I can use
|
||||
values[i] = (int64_t) &bpp->outputMsg[pos];
|
||||
|
||||
// cout<< "CC: BIN16 " << i << " "
|
||||
// << hex
|
||||
// << *((int64_t*)values[i])
|
||||
// << " "
|
||||
// << *(((int64_t*)values[i]) +1)
|
||||
// << endl;
|
||||
pos += 16;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
|
||||
case 8:
|
||||
for (i = 0, pos = sizeof(NewColResultHeader); i < outMsg->NVALS; ++i)
|
||||
{
|
||||
@ -346,6 +371,14 @@ void ColumnCommand::process_OT_DATAVALUE()
|
||||
// cout << "rid Count is " << bpp->ridCount << endl;
|
||||
switch (colType.colWidth)
|
||||
{
|
||||
case 16:
|
||||
{
|
||||
memcpy(values, outMsg + 1, outMsg->NVALS << 3);
|
||||
cout << " CC: first value is " << values[0] << endl;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case 8:
|
||||
{
|
||||
memcpy(values, outMsg + 1, outMsg->NVALS << 3);
|
||||
@ -459,6 +492,9 @@ void ColumnCommand::createCommand(ByteStream& bs)
|
||||
bs >> BOP;
|
||||
bs >> filterCount;
|
||||
deserializeInlineVector(bs, lastLbid);
|
||||
|
||||
// cout << __func__ << " colType.colWidth " << colType.colWidth << endl;
|
||||
|
||||
// cout << "lastLbid count=" << lastLbid.size() << endl;
|
||||
// for (uint32_t i = 0; i < lastLbid.size(); i++)
|
||||
// cout << " " << lastLbid[i];
|
||||
@ -488,7 +524,7 @@ void ColumnCommand::resetCommand(ByteStream& bs)
|
||||
void ColumnCommand::prep(int8_t outputType, bool absRids)
|
||||
{
|
||||
/* make the template NewColRequestHeader */
|
||||
|
||||
|
||||
baseMsgLength = sizeof(NewColRequestHeader) +
|
||||
(suppressFilter ? 0 : filterString.length());
|
||||
|
||||
@ -554,7 +590,12 @@ void ColumnCommand::prep(int8_t outputType, bool absRids)
|
||||
shift = 1;
|
||||
mask = 0x01;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
cout << __FILE__<< ":" <<__LINE__ << " Fix shift and mask for 16 Bytes ?"<< endl;
|
||||
shift = 1;
|
||||
mask = 0x01;
|
||||
break;
|
||||
|
||||
default:
|
||||
cout << "CC: colWidth is " << colType.colWidth << endl;
|
||||
throw logic_error("ColumnCommand: bad column width?");
|
||||
@ -751,6 +792,9 @@ void ColumnCommand::projectResultRG(RowGroup& rg, uint32_t pos)
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 16:
|
||||
cout << __FILE__<< ":" <<__LINE__ << " Fix for 16 Bytes ?" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user