1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-06-01 22:41:43 +03:00

MCOL-991 Qualify all uses of tuple<> with boost::

This commit is contained in:
David Hall 2017-10-27 16:21:06 -05:00
parent 4985f3456e
commit 37aee9ddd1

View File

@ -75,17 +75,17 @@ namespace
{ {
struct cmpTuple { struct cmpTuple {
bool operator()(tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a, bool operator()(boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> a,
tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*> b) 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; 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; return true;
if (get<1>(a) == get<1>(b)) if (boost::get<1>(a) == boost::get<1>(b))
return get<2>(a) < get<2>(b); return boost::get<2>(a) < boost::get<2>(b);
} }
return false; return false;
} }
@ -97,7 +97,7 @@ typedef vector<RowBucket> RowBucketVec;
// The AGG_MAP type is used to maintain a list of aggregate functions in order to // 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 // detect duplicates. Since all UDAF have the same op type (ROWAGG_UDAF), we add in
// the function pointer in order to ensure uniqueness. // 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) inline RowAggFunctionType functionIdMap(int planFuncId)
{ {
@ -1320,7 +1320,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
} }
// find if this func is a duplicate // 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()) if (iter != aggFuncMap.end())
{ {
if (funct->fAggFunction == ROWAGG_AVG) if (funct->fAggFunction == ROWAGG_AVG)
@ -1336,7 +1336,7 @@ void TupleAggregateStep::prep1PhaseAggregate(
} }
else else
{ {
aggFuncMap.insert(make_pair(make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex)); aggFuncMap.insert(make_pair(boost::make_tuple(key, aggOp, pUDAFFunc), funct->fOutputColumnIndex));
} }
} }
@ -1535,7 +1535,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]); typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[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++; colAgg++;
} }
@ -1573,7 +1573,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
typeAgg.push_back(typeProj[colProj]); typeAgg.push_back(typeProj[colProj]);
widthAgg.push_back(widthProj[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++; colAgg++;
} }
@ -1603,7 +1603,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
SP_ROWAGG_FUNC_t funct(new RowAggFunctionCol( SP_ROWAGG_FUNC_t funct(new RowAggFunctionCol(
aggOp, stats, colAgg, colAgg, -1)); aggOp, stats, colAgg, colAgg, -1));
functionVec1.push_back(funct); 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++; colAgg++;
continue; continue;
@ -1654,11 +1654,11 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAgg)); funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAgg));
} }
// skip if this is a duplicate // 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; continue;
functionVec1.push_back(funct); 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) switch (aggOp)
{ {
@ -1892,7 +1892,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
{ {
SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(i, -1)); SP_ROWAGG_GRPBY_t groupby(new RowAggGroupByCol(i, -1));
groupByNoDist.push_back(groupby); 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 // locate the return column position in aggregated rowgroup
@ -1906,7 +1906,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) != if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() ) 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()) if (it != aggFuncMap.end())
{ {
colAgg = it->second; colAgg = it->second;
@ -2009,7 +2009,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
case ROWAGG_BIT_XOR: case ROWAGG_BIT_XOR:
default: 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()) if (it != aggFuncMap.end())
{ {
colAgg = it->second; colAgg = it->second;
@ -2036,7 +2036,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
// check if a SUM or COUNT covered by AVG // check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME) 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()) if (it != aggFuncMap.end())
{ {
// false alarm // false alarm
@ -2206,7 +2206,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
functionVec2.push_back(funct); functionVec2.push_back(funct);
// find if this func is a duplicate // 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()) if (iter != aggDupFuncMap.end())
{ {
if (funct->fAggFunction == ROWAGG_AVG) if (funct->fAggFunction == ROWAGG_AVG)
@ -2221,7 +2221,7 @@ void TupleAggregateStep::prep1PhaseDistinctAggregate(
} }
else else
{ {
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc), aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex)); funct->fOutputColumnIndex));
} }
@ -2670,7 +2670,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]); typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[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++; colAggPm++;
} }
@ -2708,7 +2708,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
typeAggPm.push_back(typeProj[colProj]); typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[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++; colAggPm++;
} }
@ -2763,11 +2763,11 @@ void TupleAggregateStep::prep2PhasesAggregate(
funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAggPm)); funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAggPm));
} }
// skip if this is a duplicate // 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; continue;
functionVecPm.push_back(funct); 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) switch (aggOp)
{ {
@ -3004,7 +3004,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
pUDAFFunc = udafc->getContext().getFunction(); 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()) if (it != aggFuncMap.end())
{ {
colPm = it->second; colPm = it->second;
@ -3024,7 +3024,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
// check if a SUM or COUNT covered by AVG // check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME) 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()) if (it != aggFuncMap.end())
{ {
// false alarm // false alarm
@ -3163,7 +3163,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
functionVecUm.push_back(funct); functionVecUm.push_back(funct);
// find if this func is a duplicate // 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()) if (iter != aggDupFuncMap.end())
{ {
if (funct->fAggFunction == ROWAGG_AVG) if (funct->fAggFunction == ROWAGG_AVG)
@ -3178,7 +3178,7 @@ void TupleAggregateStep::prep2PhasesAggregate(
} }
else else
{ {
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc), aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex)); funct->fOutputColumnIndex));
} }
@ -3418,7 +3418,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]); typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[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++; colAggPm++;
} }
@ -3456,7 +3456,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
typeAggPm.push_back(typeProj[colProj]); typeAggPm.push_back(typeProj[colProj]);
widthAggPm.push_back(width[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++; colAggPm++;
} }
@ -3515,11 +3515,11 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAggPm)); funct.reset(new RowAggFunctionCol(aggOp, stats, colProj, colAggPm));
} }
// skip if this is a duplicate // 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; continue;
functionVecPm.push_back(funct); 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) switch (aggOp)
{ {
@ -3796,7 +3796,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) != if (find(jobInfo.distinctColVec.begin(), jobInfo.distinctColVec.end(), retKey) !=
jobInfo.distinctColVec.end() ) 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()) if (it != aggFuncMap.end())
{ {
colUm = it->second; colUm = it->second;
@ -3904,7 +3904,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
case ROWAGG_CONSTANT: case ROWAGG_CONSTANT:
default: 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()) if (it != aggFuncMap.end())
{ {
colUm = it->second; colUm = it->second;
@ -3924,7 +3924,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
// check if a SUM or COUNT covered by AVG // check if a SUM or COUNT covered by AVG
if (aggOp == ROWAGG_SUM || aggOp == ROWAGG_COUNT_COL_NAME) 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()) if (it != aggFuncMap.end())
{ {
// false alarm // false alarm
@ -4054,7 +4054,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
functionVecUm.push_back(funct); functionVecUm.push_back(funct);
// find if this func is a duplicate // 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()) if (iter != aggDupFuncMap.end())
{ {
if (funct->fAggFunction == ROWAGG_AVG) if (funct->fAggFunction == ROWAGG_AVG)
@ -4070,7 +4070,7 @@ void TupleAggregateStep::prep2PhasesDistinctAggregate(
} }
else else
{ {
aggDupFuncMap.insert(make_pair(make_tuple(retKey, aggOp, pUDAFFunc), aggDupFuncMap.insert(make_pair(boost::make_tuple(retKey, aggOp, pUDAFFunc),
funct->fOutputColumnIndex)); funct->fOutputColumnIndex));
} }