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-4412 Introduce TypeHandler::getEmptyValueForType to return const ptr for an empty value
WE changes for SQL DML and DDL operations Changes for bulk operations Changes for scanning operations Cleanup
This commit is contained in:
@ -563,10 +563,9 @@ int BulkLoad::preProcess( Job& job, int tableNo,
|
||||
job.jobTableList[tableNo].colList[i].weType = curColStruct.colType;
|
||||
// set width to correct column width
|
||||
job.jobTableList[tableNo].colList[i].width = curColStruct.colWidth;
|
||||
getEmptyRowValue(
|
||||
job.jobTableList[tableNo].colList[i].dataType,
|
||||
job.jobTableList[tableNo].colList[i].width,
|
||||
(uint8_t*)&job.jobTableList[tableNo].colList[i].emptyVal);
|
||||
job.jobTableList[tableNo].colList[i].emptyVal =
|
||||
getEmptyRowValue(job.jobTableList[tableNo].colList[i].dataType,
|
||||
job.jobTableList[tableNo].colList[i].width);
|
||||
|
||||
// check HWM for column file
|
||||
rc = BRMWrapper::getInstance()->getDbRootHWMInfo( curJobCol.mapOid,
|
||||
|
@ -115,9 +115,11 @@ int ColumnBuffer::writeToFile(int startOffset, int writeSize, bool fillUpWEmptie
|
||||
{
|
||||
BlockOp blockOp;
|
||||
newBuf = new unsigned char[BYTE_PER_BLOCK];
|
||||
uint8_t* emptyVal = (uint8_t*) alloca(fColInfo->column.width);
|
||||
blockOp.getEmptyRowValue(fColInfo->column.dataType,
|
||||
fColInfo->column.width, emptyVal);
|
||||
blockOp.findTypeHandler(fColInfo->column.width,
|
||||
fColInfo->column.dataType);
|
||||
const uint8_t* emptyVal = blockOp.getEmptyRowValue(fColInfo->column.dataType,
|
||||
fColInfo->column.width);
|
||||
|
||||
::memcpy(static_cast<void *>(newBuf),
|
||||
static_cast<const void *>(fBuffer + startOffset), writeSize);
|
||||
blockOp.setEmptyBuf(newBuf + writeSize, BYTE_PER_BLOCK - writeSize,
|
||||
|
@ -132,7 +132,7 @@ int ColumnBufferCompressed::resetToBeCompressedColBuf(
|
||||
|
||||
BlockOp::setEmptyBuf( fToBeCompressedBuffer,
|
||||
IDBCompressInterface::UNCOMPRESSED_INBUF_LEN,
|
||||
(uint8_t*)&fColInfo->column.emptyVal,
|
||||
fColInfo->column.emptyVal,
|
||||
fColInfo->column.width );
|
||||
|
||||
if (fLog->isDebug( DEBUG_2 ))
|
||||
@ -317,7 +317,7 @@ int ColumnBufferCompressed::writeToFile(int startOffset, int writeSize,
|
||||
// Start over again loading a new to-be-compressed buffer
|
||||
BlockOp::setEmptyBuf( fToBeCompressedBuffer,
|
||||
IDBCompressInterface::UNCOMPRESSED_INBUF_LEN,
|
||||
(uint8_t*)&fColInfo->column.emptyVal,
|
||||
fColInfo->column.emptyVal,
|
||||
fColInfo->column.width );
|
||||
|
||||
fToBeCompressedCapacity =
|
||||
@ -628,7 +628,7 @@ int ColumnBufferCompressed::initToBeCompressedBuffer(long long& startFileOffset)
|
||||
new unsigned char[IDBCompressInterface::UNCOMPRESSED_INBUF_LEN];
|
||||
BlockOp::setEmptyBuf( fToBeCompressedBuffer,
|
||||
IDBCompressInterface::UNCOMPRESSED_INBUF_LEN,
|
||||
(uint8_t*)&fColInfo->column.emptyVal,
|
||||
fColInfo->column.emptyVal,
|
||||
fColInfo->column.width );
|
||||
bNewBuffer = true;
|
||||
}
|
||||
@ -743,7 +743,7 @@ int ColumnBufferCompressed::initToBeCompressedBuffer(long long& startFileOffset)
|
||||
{
|
||||
BlockOp::setEmptyBuf( fToBeCompressedBuffer,
|
||||
IDBCompressInterface::UNCOMPRESSED_INBUF_LEN,
|
||||
(uint8_t*)&fColInfo->column.emptyVal,
|
||||
fColInfo->column.emptyVal,
|
||||
fColInfo->column.width );
|
||||
}
|
||||
|
||||
|
@ -297,6 +297,7 @@ void ColumnInfo::setupDelayedFileCreation(
|
||||
column.mapOid,
|
||||
column.compressionType,
|
||||
dbRoot, partition, segment );
|
||||
colOp->findTypeHandler(column.width, column.dataType);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@ -896,7 +897,7 @@ int ColumnInfo::extendColumnOldExtent(
|
||||
}
|
||||
|
||||
rc = colOp->expandAbbrevColumnExtent( pFile, dbRootNext,
|
||||
(uint8_t*)&column.emptyVal, column.width);
|
||||
column.emptyVal, column.width);
|
||||
|
||||
if (rc != NO_ERROR)
|
||||
{
|
||||
@ -1422,6 +1423,7 @@ int ColumnInfo::setupInitialColumnExtent(
|
||||
column.mapOid,
|
||||
column.compressionType,
|
||||
dbRoot, partition, segment );
|
||||
colOp->findTypeHandler(column.width, column.dataType);
|
||||
|
||||
// Open the column file
|
||||
if (!colOp->exists(column.mapOid, dbRoot, partition, segment) )
|
||||
|
@ -540,7 +540,7 @@ int ColumnInfoCompressed::extendColumnOldExtent(
|
||||
int rc = colOp->fillCompColumnExtentEmptyChunks(
|
||||
curCol.dataFile.fid,
|
||||
curCol.colWidth,
|
||||
(uint8_t*)&column.emptyVal,
|
||||
column.emptyVal,
|
||||
curCol.dataFile.fDbRoot,
|
||||
curCol.dataFile.fPartition,
|
||||
curCol.dataFile.fSegment,
|
||||
|
Reference in New Issue
Block a user