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-1197 Make -c work in cpimport
It turns out -c wasn't actually connected to anything and now with have BLOB/TEXT it is pretty useful. If -c is set to < 1MB then 1MB is used, otherwise it will use the selected buffer size.
This commit is contained in:
@ -87,6 +87,15 @@ WEFileReadThread::WEFileReadThread(WESDHandler& aSdh):fSdh(aSdh),
|
||||
{
|
||||
//TODO batch qty to get from config
|
||||
fBatchQty = 10000;
|
||||
if (fSdh.getReadBufSize() < DEFAULTBUFFSIZE)
|
||||
{
|
||||
fBuffSize = DEFAULTBUFFSIZE;
|
||||
}
|
||||
else
|
||||
{
|
||||
fBuffSize = fSdh.getReadBufSize();
|
||||
}
|
||||
fBuff = new char [fBuffSize];
|
||||
|
||||
}
|
||||
|
||||
@ -106,6 +115,7 @@ WEFileReadThread::~WEFileReadThread()
|
||||
delete fpThread;
|
||||
}
|
||||
fpThread=0;
|
||||
delete []fBuff;
|
||||
//cout << "WEFileReadThread destructor called" << endl;
|
||||
}
|
||||
|
||||
@ -330,16 +340,16 @@ unsigned int WEFileReadThread::readDataFile(messageqcpp::SBS& Sbs)
|
||||
if(fEnclEsc)
|
||||
{
|
||||
//pStart = aBuff;
|
||||
aLen = getNextRow(fInFile, fBuff, sizeof(fBuff)-1);
|
||||
aLen = getNextRow(fInFile, fBuff, fBuffSize-1);
|
||||
}
|
||||
else
|
||||
{
|
||||
fInFile.getline(fBuff, sizeof(fBuff)-1);
|
||||
fInFile.getline(fBuff, fBuffSize-1);
|
||||
aLen=fInFile.gcount();
|
||||
}
|
||||
////aLen chars incl \n, Therefore aLen-1; '<<' oper won't go past it
|
||||
//cout << "Data Length " << aLen <<endl;
|
||||
if((aLen < (sizeof(fBuff)-2)) && (aLen>0))
|
||||
if((aLen < (fBuffSize-2)) && (aLen>0))
|
||||
{
|
||||
fBuff[aLen-1] = '\n';
|
||||
fBuff[aLen]=0;
|
||||
@ -348,7 +358,7 @@ unsigned int WEFileReadThread::readDataFile(messageqcpp::SBS& Sbs)
|
||||
aIdx++;
|
||||
if(fSdh.getDebugLvl()>2) cout << "File data line = " << aIdx <<endl;
|
||||
}
|
||||
else if(aLen>=sizeof(fBuff)-2) //Didn't hit delim; BIG ROW
|
||||
else if(aLen>=fBuffSize-2) //Didn't hit delim; BIG ROW
|
||||
{
|
||||
cout <<"Bad Row data " << endl;
|
||||
cout << fBuff << endl;
|
||||
|
Reference in New Issue
Block a user