1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +03:00

Merge branch 'develop-1.1' into develop

This commit is contained in:
Andrew Hutchings 2017-10-30 10:29:30 +00:00
commit a347a8f5aa
10 changed files with 74 additions and 72 deletions

View File

@ -76,19 +76,19 @@ namespace
struct cmpTuple
{
bool operator()(tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a,
tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> b)
bool operator()(boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a,
boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> b)
{
if (get<0>(a) < get<0>(b))
if (boost::get<0>(a) < boost::get<0>(b))
return true;
if (get<0>(a) == get<0>(b))
if (boost::get<0>(a) == boost::get<0>(b))
{
if (get<1>(a) < get<1>(b))
if (boost::get<1>(a) < boost::get<1>(b))
return true;
if (get<1>(a) == get<1>(b))
return get<2>(a) < get<2>(b);
if (boost::get<1>(a) == boost::get<1>(b))
return boost::get<2>(a) < boost::get<2>(b);
}
return false;
@ -101,7 +101,7 @@ typedef vector<RowBucket> RowBucketVec;
// The AGG_MAP type is used to maintain a list of aggregate functions in order to
// detect duplicates. Since all UDAF have the same op type (ROWAGG_UDAF), we add in
// the function pointer in order to ensure uniqueness.
typedef map<tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*>, uint64_t, cmpTuple> AGG_MAP;
typedef map<boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*>, uint64_t, cmpTuple> AGG_MAP;
inline RowAggFunctionType functionIdMap(int planFuncId)
{
@ -1477,7 +1477,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
}
// find if this func is a duplicate
AGG_MAP::iterator iter = aggFuncMap.find(make_tuple(key, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggFuncMap.find(boost::make_tuple(key, aggOp, pUDAFFunc));
if (iter != aggFuncMap.end())
{
@ -1494,7 +1494,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
}
else
{
aggFuncMap.insert(make_pair(make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex));
aggFuncMap.insert(make_pair(boost::make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex));
}
}
@ -1704,7 +1704,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
colAgg++;
}
@ -1745,7 +1745,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[colAgg], 0, pUDAFFunc), colAgg));
colAgg++;
}
@ -1775,7 +1775,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
SP_ROWAGG_FUNC_t funct(new RowAggFunctionCol(
aggOp, stats, colAgg, colAgg, -1));
functionVec1.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
colAgg++;
continue;
@ -1831,11 +1831,11 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
}
// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;
functionVec1.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAgg));
switch (aggOp)
{
@ -2081,7 +2081,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
{
SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(i, -1));
groupByNoDist.push_back(groupby);
aggFuncMap.insert(make_pair(make_tuple(keysAgg[i], 0, pUDAFFunc), i));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAgg[i], 0, pUDAFFunc), i));
}
// locate the return column position in aggregated rowgroup
@ -2096,7 +2096,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() )
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, 0, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, 0, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -2208,7 +2208,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
case ROWAGG_BIT_XOR:
default:
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -2239,7 +2239,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -2417,7 +2417,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
functionVec2.push_back(funct);
// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (iter != aggDupFuncMap.end())
{
@ -2434,7 +2434,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}
@ -2910,7 +2910,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}
@ -2951,7 +2951,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}
@ -3011,11 +3011,11 @@ void TupleAggregateStep::prep2PhasesAggregate(
}
// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;
functionVecPm.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
switch (aggOp)
{
@ -3269,7 +3269,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
pUDAFFunc = udafc->getContext().getFunction();
}
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -3290,7 +3290,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -3435,7 +3435,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
functionVecUm.push_back(funct);
// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (iter != aggDupFuncMap.end())
{
@ -3452,7 +3452,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}
@ -3707,7 +3707,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}
@ -3748,7 +3748,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[colProj]);
aggFuncMap.insert(make_pair(make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(keysAggPm[colAggPm], 0, pUDAFFunc), colAggPm));
colAggPm++;
}
@ -3815,11 +3815,11 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
}
// skip if this is a duplicate
if (aggFuncMap.find(make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
if (aggFuncMap.find(boost::make_tuple(aggKey, aggOp, pUDAFFunc)) != aggFuncMap.end())
continue;
functionVecPm.push_back(funct);
aggFuncMap.insert(make_pair(make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
aggFuncMap.insert(make_pair(boost::make_tuple(aggKey, aggOp, pUDAFFunc), colAggPm));
switch (aggOp)
{
@ -4110,7 +4110,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() )
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, 0, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, 0, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -4228,7 +4228,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
case ROWAGG_CONSTANT:
default:
{
AGG_MAP::iterator it = aggFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator it = aggFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -4249,7 +4249,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
// check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME)
{
it = aggFuncMap.find(make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
it = aggFuncMap.find(boost::make_tuple(returnedColVec[i].first, ROWAGG_AVG, pUDAFFunc));
if (it != aggFuncMap.end())
{
@ -4384,7 +4384,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
functionVecUm.push_back(funct);
// find if this func is a duplicate
AGG_MAP::iterator iter = aggDupFuncMap.find(make_tuple(retKey, aggOp, pUDAFFunc));
AGG_MAP::iterator iter = aggDupFuncMap.find(boost::make_tuple(retKey, aggOp, pUDAFFunc));
if (iter != aggDupFuncMap.end())
{
@ -4401,7 +4401,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
}
else
{
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc),
aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex));
}

View File

@ -1 +1,2 @@
#!/bin/bash
astyle --style=allman --indent=spaces=4 --indent-switches --break-blocks --pad-comma --pad-oper --pad-header --lineend=linux --align-pointer=type --recursive "*.cpp" "*.h"

View File

@ -458,6 +458,7 @@
<JavaHome>unassigned</JavaHome>
<JavaPath>unassigned</JavaPath>
<MySQLPort>3306</MySQLPort>
<DistributedInstall>y</DistributedInstall>
</Installation>
<ExtentMap>
<!--

View File

@ -911,6 +911,9 @@ int main(int argc, char* argv[])
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias" << endl << endl;
exit (1);
}

View File

@ -3990,6 +3990,8 @@ int main(int argc, char* argv[])
cout << "Enter 'mcsmysql' to access the MariaDB ColumnStore SQL console" << endl;
cout << "Enter 'mcsadmin' to access the MariaDB ColumnStore Admin console" << endl << endl;
cout << "NOTE: The MariaDB ColumnStore Alias Commands are in /etc/profile.d/columnstoreAlias" << endl << endl;
exit(1);
}

View File

@ -602,7 +602,7 @@ static void startMgrProcessThread()
}
catch (...)
{
log.writeLog(__LINE__, "addModule - ERROR: get DistributedInstall", LOG_TYPE_ERROR);
log.writeLog(__LINE__, "ERROR: get DistributedInstall", LOG_TYPE_ERROR);
}
//Send out a start service just to make sure Columnstore is runing on remote nodes

View File

@ -5157,7 +5157,7 @@ int ProcessMonitor::changeMyCnf(std::string type)
{
*/ //get slave id based on ExeMgrx setup
string slaveID = "0";
string slaveModuleName = config.moduleName();
string localModuleName = config.moduleName();
for ( int id = 1 ; ; id++ )
{
@ -5170,37 +5170,9 @@ int ProcessMonitor::changeMyCnf(std::string type)
Config* sysConfig = Config::makeConfig();
moduleName = sysConfig->getConfig(Section, "Module");
if ( moduleName == slaveModuleName )
if ( moduleName == localModuleName )
{
slaveID = oam.itoa(id);
// if slave ID from above is 1, then it means this is a former Original master and use the ID of the current Master
if ( slaveID == "1" )
{
string PrimaryUMModuleName;
oam.getSystemConfig("PrimaryUMModuleName", PrimaryUMModuleName);
for ( int mid = 1 ; ; mid++ )
{
string Section = "ExeMgr" + oam.itoa(mid);
string moduleName;
try
{
Config* sysConfig = Config::makeConfig();
moduleName = sysConfig->getConfig(Section, "Module");
if ( moduleName == PrimaryUMModuleName )
{
slaveID = oam.itoa(mid);
break;
}
}
catch (...) {}
}
}
break;
}
}

View File

@ -220,12 +220,14 @@ int main(int argc, char* argv[])
string DataRedundancyConfig;
string DataRedundancyCopies;
string DataRedundancyStorageType;
string DataRedundancyNetworkType;
try
{
DataRedundancyConfig = sysConfigOld->getConfig(InstallSection, "DataRedundancyConfig");
DataRedundancyCopies = sysConfigOld->getConfig(InstallSection, "DataRedundancyCopies");
DataRedundancyStorageType = sysConfigOld->getConfig(InstallSection, "DataRedundancyStorageType");
DataRedundancyNetworkType = sysConfigOld->getConfig(InstallSection, "DataRedundancyNetworkType");
}
catch (...)
{}
@ -237,6 +239,7 @@ int main(int argc, char* argv[])
sysConfigNew->setConfig(InstallSection, "DataRedundancyConfig", DataRedundancyConfig);
sysConfigNew->setConfig(InstallSection, "DataRedundancyCopies", DataRedundancyCopies);
sysConfigNew->setConfig(InstallSection, "DataRedundancyStorageType", DataRedundancyStorageType);
sysConfigNew->setConfig(InstallSection, "DataRedundancyNetworkType", DataRedundancyNetworkType);
}
catch (...)
{}
@ -1650,6 +1653,24 @@ int main(int argc, char* argv[])
catch (...)
{}
}
if ( !DataRedundancyConfig.empty() )
{
try
{
string dbrootPMsID = "DBRoot" + oam.itoa(id) + "PMs";
string dbrootPMs = sysConfigOld->getConfig("DataRedundancyConfig", dbrootPMsID);
try
{
sysConfigNew->setConfig("DataRedundancyConfig", dbrootPMsID, dbrootPMs);
}
catch (...)
{}
}
catch (...)
{}
}
}
}
catch (exception& e)

View File

@ -128,7 +128,7 @@ void WF_lead_lag<T>::parseParms(const std::vector<execplan::SRCP>& parms)
fLead = 1;
fRespectNulls = true;
fDefNull = false;
fDefault = (T)0;
// fDefault = (T)0; // Won't work for std::string. Default should always be set below.
fOffsetNull = false;
fOffset = 0;

View File

@ -538,8 +538,8 @@ void* WindowFunctionType::getNullValueByType(int ct, int pos)
case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARCHAR:
{
uint64_t len = fRow.getColumnWidth(pos);
// uint64_t len = fRow.getColumnWidth(pos);
#if 0
switch (len)
{
case 1:
@ -567,6 +567,8 @@ void* WindowFunctionType::getNullValueByType(int ct, int pos)
break;
}
#endif
v = &stringNull;
break;
}