1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -42,318 +42,310 @@ using namespace std;
using namespace joblist;
using namespace execplan;
CalpontSystemCatalog::TableColName testcol = { "tpch", "orders", "o_orderkey"};
CalpontSystemCatalog::TableColName largecol = { "tpch", "lineitem", "l_orderkey"};
CalpontSystemCatalog::TableColName testcol = {"tpch", "orders", "o_orderkey"};
CalpontSystemCatalog::TableColName largecol = {"tpch", "lineitem", "l_orderkey"};
class JobStepDriver : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE(JobStepDriver);
CPPUNIT_TEST_SUITE(JobStepDriver);
// CPPUNIT_TEST(indexTest_ss1);
// CPPUNIT_TEST(indexTest_ss2);
// CPPUNIT_TEST(indexTest_many);
// CPPUNIT_TEST(indexTest_many2);
CPPUNIT_TEST(indexTest_lists);
// CPPUNIT_TEST(indexTest_ss1);
// CPPUNIT_TEST(indexTest_ss2);
// CPPUNIT_TEST(indexTest_many);
// CPPUNIT_TEST(indexTest_many2);
CPPUNIT_TEST(indexTest_lists);
CPPUNIT_TEST_SUITE_END();
CPPUNIT_TEST_SUITE_END();
private:
int getIndexOID(const CalpontSystemCatalog::TableColName& col, boost::shared_ptr<CalpontSystemCatalog> cat)
{
const CalpontSystemCatalog::IndexNameList iNames = cat->colValueSysindexCol(col);
private:
int getIndexOID(const CalpontSystemCatalog::TableColName& col, boost::shared_ptr<CalpontSystemCatalog> cat)
if (0 == iNames.size())
{
const CalpontSystemCatalog::IndexNameList iNames = cat->colValueSysindexCol(col);
if (0 == iNames.size())
{
cout << "No index for " << col << endl;
return -1;
}
CalpontSystemCatalog::IndexOID ixoid = cat->lookupIndexNbr(*iNames.begin());
return ixoid.objnum;
cout << "No index for " << col << endl;
return -1;
}
public:
// 1 search string
void indexTest_ss1()
CalpontSystemCatalog::IndexOID ixoid = cat->lookupIndexNbr(*iNames.begin());
return ixoid.objnum;
}
public:
// 1 search string
void indexTest_ss1()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); // returns 3154
if (0 > oid)
return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_EQ, 3);
step0.run();
step0.join();
ElementType e;
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e))
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); //returns 3154
if (0 > oid) return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_EQ, 3);
step0.run();
step0.join();
ElementType e;
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e) )
{
cout << i++ << " <ss1 Rid: " << (int)e.first << ">\n";
}
cout << i++ << " <ss1 Rid: " << (int)e.first << ">\n";
}
// 2 search strings
void indexTest_ss2()
}
// 2 search strings
void indexTest_ss2()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); // returns 3154
if (0 > oid)
return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_GT, 3);
step0.addSearchStr(COMPARE_LT, 60);
step0.setBOP(BOP_AND);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
int it = dlo->getIterator();
int i = 1;
ElementType e;
while (dlo->next(it, &e))
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); //returns 3154
if (0 > oid) return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_GT, 3);
step0.addSearchStr(COMPARE_LT, 60);
step0.setBOP(BOP_AND);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
int it = dlo->getIterator();
int i = 1;
ElementType e;
while (dlo->next(it, &e) )
{
cout << i++ << " <ss2 Rid: " << (int)e.first << ">\n";
}
cout << i++ << " <ss2 Rid: " << (int)e.first << ">\n";
}
// input list of tokens
void indexTest_many()
}
// input list of tokens
void indexTest_many()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
// dec->addSession(12345);
// dec->addStep(12345, 0);
JobStepAssociation inJs;
AnyDataListSPtr spdli(new AnyDataList());
BandedDL<ElementType>* dli = new BandedDL<ElementType>(1, rm);
spdli->bandedDL(dli);
ElementType e;
for (e.second = 1; e.second < 100; ++e.second)
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
// dec->addSession(12345);
// dec->addStep(12345, 0);
JobStepAssociation inJs;
AnyDataListSPtr spdli(new AnyDataList());
BandedDL<ElementType>* dli = new BandedDL<ElementType>(1, rm);
spdli->bandedDL(dli);
ElementType e;
for (e.second = 1; e.second < 100; ++e.second)
{
if (0 == e.second % 3 )
dli->insert(e);
}
dli->endOfInput();
inJs.outAdd(spdli);
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); //returns 3154
if (0 > oid) return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
// dec->removeSession(12345);
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e) )
{
cout << i++ << " <many Rid: " << (int)e.first << ">\n";
}
}
// 2 tokens; should use search string
void indexTest_many2()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
// dec->addSession(12345);
// dec->addStep(12345, 0);
JobStepAssociation inJs;
AnyDataListSPtr spdli(new AnyDataList());
BandedDL<ElementType>* dli = new BandedDL<ElementType>(1, rm);
spdli->bandedDL(dli);
ElementType e;
e.second = 3;
if (0 == e.second % 3)
dli->insert(e);
e.second = 32;
dli->insert(e);
dli->endOfInput();
inJs.outAdd(spdli);
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); //returns 3154
if (0 > oid) return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
// dec->removeSession(12345);
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e) )
{
cout << i++ << " <many2 Rid: " << (int)e.first << ">\n";
}
}
//Send enough data so that index list must send it back to primitives
void indexTest_lists()
dli->endOfInput();
inJs.outAdd(spdli);
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); // returns 3154
if (0 > oid)
return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
// dec->removeSession(12345);
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e))
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(largecol, cat); //returns 3152
if (0 > oid) return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_GT, 3);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
//cout << "lists returned " << dlo->size() << " values.\n";
cout << i++ << " <many Rid: " << (int)e.first << ">\n";
}
}
// 2 tokens; should use search string
void indexTest_many2()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
// dec->addSession(12345);
// dec->addStep(12345, 0);
JobStepAssociation inJs;
AnyDataListSPtr spdli(new AnyDataList());
BandedDL<ElementType>* dli = new BandedDL<ElementType>(1, rm);
spdli->bandedDL(dli);
ElementType e;
e.second = 3;
dli->insert(e);
e.second = 32;
dli->insert(e);
dli->endOfInput();
inJs.outAdd(spdli);
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(testcol, cat); // returns 3154
if (0 > oid)
return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
// dec->removeSession(12345);
int it = dlo->getIterator();
int i = 1;
while (dlo->next(it, &e))
{
cout << i++ << " <many2 Rid: " << (int)e.first << ">\n";
}
}
// Send enough data so that index list must send it back to primitives
void indexTest_lists()
{
ResourceManager rm;
DistributedEngineComm* dec = DistributedEngineComm::instance(rm);
boost::shared_ptr<CalpontSystemCatalog> cat = CalpontSystemCatalog::makeCalpontSystemCatalog();
JobStepAssociation inJs;
JobStepAssociation walkJs;
AnyDataListSPtr spdlw(new AnyDataList());
BandedDL<ElementType>* dlw = new BandedDL<ElementType>(1, rm);
spdlw->bandedDL(dlw);
walkJs.outAdd(spdlw);
int oid = getIndexOID(largecol, cat); // returns 3152
if (0 > oid)
return;
pIdxWalk step0(inJs, walkJs, dec, cat, oid, 12345, 999, 7, 0, 0, 0, 0);
step0.addSearchStr(COMPARE_GT, 3);
step0.run();
step0.join();
JobStepAssociation outJs;
AnyDataListSPtr spdlo(new AnyDataList());
BandedDL<ElementType>* dlo = new BandedDL<ElementType>(1, rm);
spdlo->bandedDL(dlo);
outJs.outAdd(spdlo);
pIdxList step1(walkJs, outJs, dec, cat, 12345, 999, 7, 0, 0, 0, 0);
step1.run();
step1.join();
// cout << "lists returned " << dlo->size() << " values.\n";
}
};
CPPUNIT_TEST_SUITE_REGISTRATION(JobStepDriver);
int main( int argc, char** argv)
int main(int argc, char** argv)
{
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest( registry.makeTest() );
bool wasSuccessful = runner.run( "", false );
return (wasSuccessful ? 0 : 1);
CppUnit::TextUi::TestRunner runner;
CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry();
runner.addTest(registry.makeTest());
bool wasSuccessful = runner.run("", false);
return (wasSuccessful ? 0 : 1);
}