1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-07 09:01:10 +03:00

MCOL-5021 Add support for AUX column in the client code calling

CalpontSystemCatalog::columnRIDs().
This commit is contained in:
Gagan Goel
2022-06-15 16:40:26 -04:00
parent 439db48c5a
commit 9b6d3c3870
8 changed files with 40 additions and 45 deletions

View File

@ -562,8 +562,19 @@ void DDLPackageProcessor::createFiles(CalpontSystemCatalog::TableName aTableName
{ {
SUMMARY_INFO("DDLPackageProcessor::createFiles"); SUMMARY_INFO("DDLPackageProcessor::createFiles");
boost::shared_ptr<CalpontSystemCatalog> systemCatalogPtr = boost::shared_ptr<CalpontSystemCatalog> systemCatalogPtr =
CalpontSystemCatalog::makeCalpontSystemCatalog(1); CalpontSystemCatalog::makeCalpontSystemCatalog(1);
CalpontSystemCatalog::RIDList ridList = systemCatalogPtr->columnRIDs(aTableName); CalpontSystemCatalog::RIDList ridList = systemCatalogPtr->columnRIDs(aTableName);
CalpontSystemCatalog::OID tableAUXColOid =
systemCatalogPtr->tableAUXColumnOID(aTableName);
if (tableAUXColOid > 3000)
{
CalpontSystemCatalog::ROPair auxRoPair;
auxRoPair.rid = 0;
auxRoPair.objnum = tableAUXColOid;
ridList.push_back(auxRoPair);
}
fWEClient->addQueue(uniqueId); fWEClient->addQueue(uniqueId);
CalpontSystemCatalog::ColType colType; CalpontSystemCatalog::ColType colType;
ByteStream bytestream; ByteStream bytestream;

View File

@ -70,6 +70,7 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage(
} }
std::vector<CalpontSystemCatalog::OID> oidList; std::vector<CalpontSystemCatalog::OID> oidList;
CalpontSystemCatalog::OID tableAuxColOid;
CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::RIDList tableColRidList;
CalpontSystemCatalog::DictOIDList dictOIDList; CalpontSystemCatalog::DictOIDList dictOIDList;
execplan::CalpontSystemCatalog::ROPair roPair; execplan::CalpontSystemCatalog::ROPair roPair;
@ -231,6 +232,7 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage(
userTableName.table = dropPartitionStmt.fTableName->fName; userTableName.table = dropPartitionStmt.fTableName->fName;
tableColRidList = systemCatalogPtr->columnRIDs(userTableName); tableColRidList = systemCatalogPtr->columnRIDs(userTableName);
tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName);
dictOIDList = systemCatalogPtr->dictOIDs(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName);
@ -241,6 +243,11 @@ DropPartitionProcessor::DDLResult DropPartitionProcessor::processPackage(
oidList.push_back(tableColRidList[i].objnum); oidList.push_back(tableColRidList[i].objnum);
} }
if (tableAuxColOid > 3000)
{
oidList.push_back(tableAuxColOid);
}
for (unsigned i = 0; i < dictOIDList.size(); i++) for (unsigned i = 0; i < dictOIDList.size(); i++)
{ {
if (dictOIDList[i].dictOID > 3000) if (dictOIDList[i].dictOID > 3000)

View File

@ -64,6 +64,7 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage(
} }
std::vector<CalpontSystemCatalog::OID> oidList; std::vector<CalpontSystemCatalog::OID> oidList;
CalpontSystemCatalog::OID tableAuxColOid;
CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::RIDList tableColRidList;
CalpontSystemCatalog::DictOIDList dictOIDList; CalpontSystemCatalog::DictOIDList dictOIDList;
std::string processName("DDLProc"); std::string processName("DDLProc");
@ -193,6 +194,7 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage(
userTableName.table = markPartitionStmt.fTableName->fName; userTableName.table = markPartitionStmt.fTableName->fName;
tableColRidList = systemCatalogPtr->columnRIDs(userTableName); tableColRidList = systemCatalogPtr->columnRIDs(userTableName);
tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName);
dictOIDList = systemCatalogPtr->dictOIDs(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName);
@ -203,6 +205,11 @@ MarkPartitionProcessor::DDLResult MarkPartitionProcessor::processPackage(
oidList.push_back(tableColRidList[i].objnum); oidList.push_back(tableColRidList[i].objnum);
} }
if (tableAuxColOid > 3000)
{
oidList.push_back(tableAuxColOid);
}
for (unsigned i = 0; i < dictOIDList.size(); i++) for (unsigned i = 0; i < dictOIDList.size(); i++)
{ {
if (dictOIDList[i].dictOID > 3000) if (dictOIDList[i].dictOID > 3000)

View File

@ -64,6 +64,7 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage(
} }
std::vector<CalpontSystemCatalog::OID> oidList; std::vector<CalpontSystemCatalog::OID> oidList;
CalpontSystemCatalog::OID tableAuxColOid;
CalpontSystemCatalog::RIDList tableColRidList; CalpontSystemCatalog::RIDList tableColRidList;
CalpontSystemCatalog::DictOIDList dictOIDList; CalpontSystemCatalog::DictOIDList dictOIDList;
std::string processName("DDLProc"); std::string processName("DDLProc");
@ -195,6 +196,7 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage(
userTableName.table = restorePartitionStmt.fTableName->fName; userTableName.table = restorePartitionStmt.fTableName->fName;
tableColRidList = systemCatalogPtr->columnRIDs(userTableName); tableColRidList = systemCatalogPtr->columnRIDs(userTableName);
tableAuxColOid = systemCatalogPtr->tableAUXColumnOID(userTableName);
dictOIDList = systemCatalogPtr->dictOIDs(userTableName); dictOIDList = systemCatalogPtr->dictOIDs(userTableName);
@ -205,6 +207,11 @@ RestorePartitionProcessor::DDLResult RestorePartitionProcessor::processPackage(
oidList.push_back(tableColRidList[i].objnum); oidList.push_back(tableColRidList[i].objnum);
} }
if (tableAuxColOid > 3000)
{
oidList.push_back(tableAuxColOid);
}
for (unsigned i = 0; i < dictOIDList.size(); i++) for (unsigned i = 0; i < dictOIDList.size(); i++)
{ {
if (dictOIDList[i].dictOID > 3000) if (dictOIDList[i].dictOID > 3000)

View File

@ -577,7 +577,6 @@ TupleBPS::TupleBPS(const pColScanStep& rhs, const JobInfo& jobInfo) : BatchPrimi
if (dbrm.getExtents(fOidAux, extentsAux)) if (dbrm.getExtents(fOidAux, extentsAux))
throw runtime_error("TupleBPS::TupleBPS BRM extent lookup failure (1)"); throw runtime_error("TupleBPS::TupleBPS BRM extent lookup failure (1)");
idbassert(!extentsAux.empty());
sort(extentsAux.begin(), extentsAux.end(), BRM::ExtentSorter()); sort(extentsAux.begin(), extentsAux.end(), BRM::ExtentSorter());
extentsMap[fOidAux] = tr1::unordered_map<int64_t, EMEntry>(); extentsMap[fOidAux] = tr1::unordered_map<int64_t, EMEntry>();

View File

@ -308,6 +308,7 @@ int RedistributeWorkerThread::buildEntryList()
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(0); boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(0);
const CalpontSystemCatalog::TableName table = csc->tableName(fPlanEntry.table); const CalpontSystemCatalog::TableName table = csc->tableName(fPlanEntry.table);
CalpontSystemCatalog::RIDList cols = csc->columnRIDs(table, true); CalpontSystemCatalog::RIDList cols = csc->columnRIDs(table, true);
CalpontSystemCatalog::OID tableAuxColOid = csc->tableAUXColumnOID(table);
for (CalpontSystemCatalog::RIDList::iterator i = cols.begin(); i != cols.end(); i++) for (CalpontSystemCatalog::RIDList::iterator i = cols.begin(); i != cols.end(); i++)
fOids.push_back(i->objnum); fOids.push_back(i->objnum);
@ -317,6 +318,11 @@ int RedistributeWorkerThread::buildEntryList()
for (CalpontSystemCatalog::DictOIDList::iterator i = dicts.begin(); i != dicts.end(); i++) for (CalpontSystemCatalog::DictOIDList::iterator i = dicts.begin(); i != dicts.end(); i++)
fOids.push_back(i->dictOID); fOids.push_back(i->dictOID);
if (tableAuxColOid > 3000)
{
fOids.push_back(tableAuxColOid);
}
bool firstOid = true; // for adding segments, all columns have the same lay out. bool firstOid = true; // for adding segments, all columns have the same lay out.
uint16_t source = fPlanEntry.source; uint16_t source = fPlanEntry.source;
uint16_t target = fPlanEntry.destination; uint16_t target = fPlanEntry.destination;

View File

@ -1308,7 +1308,6 @@ uint8_t WE_DDLCommandProc::deleteSyscolumn(ByteStream& bs, std::string& err)
{ {
int rc = 0; int rc = 0;
uint32_t sessionID, tmp32; uint32_t sessionID, tmp32;
;
int txnID; int txnID;
string schema, tablename; string schema, tablename;
bs >> sessionID; bs >> sessionID;

View File

@ -962,7 +962,7 @@ uint8_t WE_DMLCommandProc::processBatchInsert(messageqcpp::ByteStream& bs, std::
if (tableAUXColOid > 3000) if (tableAUXColOid > 3000)
{ {
rc = BRMWrapper::getInstance()->getDbRootHWMInfo(tableAUXColOid, dbRootHWMInfoColVec[ridList.size()]); rc = BRMWrapper::getInstance()->getDbRootHWMInfo(tableAUXColOid, dbRootHWMInfoColVec[ridList.size()]);
colWidths.push_back(1); colWidths.push_back(execplan::AUX_COL_WIDTH);
dctnryStoreOids[ridList.size()] = 0; dctnryStoreOids[ridList.size()] = 0;
CalpontSystemCatalog::ROPair auxRoPair; CalpontSystemCatalog::ROPair auxRoPair;
auxRoPair.rid = ridList.back().rid + 1; auxRoPair.rid = ridList.back().rid + 1;
@ -2300,47 +2300,6 @@ uint8_t WE_DMLCommandProc::commitBatchAutoOn(messageqcpp::ByteStream& bs, std::s
fWEWrapper.setIsInsert(true); fWEWrapper.setIsInsert(true);
fWEWrapper.setBulkFlag(true); fWEWrapper.setBulkFlag(true);
std::map<uint32_t, uint32_t> oids;
boost::shared_ptr<CalpontSystemCatalog> systemCatalogPtr =
CalpontSystemCatalog::makeCalpontSystemCatalog(sessionId);
CalpontSystemCatalog::TableName aTableName = systemCatalogPtr->tableName(tableOid);
CalpontSystemCatalog::RIDList ridList;
try
{
ridList = systemCatalogPtr->columnRIDs(aTableName, true);
}
catch (std::exception& ex)
{
err = ex.what();
rc = 1;
return rc;
}
for (unsigned i = 0; i < ridList.size(); i++)
{
oids[ridList[i].objnum] = ridList[i].objnum;
}
CalpontSystemCatalog::DictOIDList dictOids;
try
{
dictOids = systemCatalogPtr->dictOIDs(aTableName);
}
catch (std::exception& ex)
{
err = ex.what();
rc = 1;
return rc;
}
for (unsigned i = 0; i < dictOids.size(); i++)
{
oids[dictOids[i].dictOID] = dictOids[i].dictOID;
}
fWEWrapper.setTransId(txnID); fWEWrapper.setTransId(txnID);
fWEWrapper.setIsInsert(false); fWEWrapper.setIsInsert(false);