1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

Reformat all code to coding standard

This commit is contained in:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -44,24 +44,28 @@ using namespace messageqcpp;
using namespace execplan;
class TPCH_EXECPLAN : public CppUnit::TestFixture {
class TPCH_EXECPLAN : public CppUnit::TestFixture
{
CPPUNIT_TEST_SUITE( TPCH_EXECPLAN );
CPPUNIT_TEST_SUITE( TPCH_EXECPLAN );
CPPUNIT_TEST( Q1 );
CPPUNIT_TEST( Q1 );
CPPUNIT_TEST_SUITE_END();
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp() {
void setUp()
{
}
void tearDown() {
void tearDown()
{
}
void Q1() {
void Q1()
{
string sql = "\
select\
l_returnflag,\
@ -84,96 +88,96 @@ public:
order by\
l_returnflag,\
l_linestatus;";
CalpontSelectExecutionPlan csep;
// Returned columns
CalpontSelectExecutionPlan::ReturnedColumnList returnedColumnList;
SimpleColumn *c1 = new SimpleColumn("tpch.lineitem.l_returnflag");
SimpleColumn* c1 = new SimpleColumn("tpch.lineitem.l_returnflag");
returnedColumnList.push_back(c1);
SimpleColumn *c2 = new SimpleColumn("tpch.lineitem.l_linestatus");
SimpleColumn* c2 = new SimpleColumn("tpch.lineitem.l_linestatus");
returnedColumnList.push_back(c2);
ArithmeticColumn *c3 = new ArithmeticColumn("sum(tpch.lineitem.l_quantity)");
ArithmeticColumn* c3 = new ArithmeticColumn("sum(tpch.lineitem.l_quantity)");
c3->alias("sum_qty");
returnedColumnList.push_back(c3);
ArithmeticColumn *c4 = new ArithmeticColumn("sum(tpch.lineitem.l_extendedprice)");
returnedColumnList.push_back(c3);
ArithmeticColumn* c4 = new ArithmeticColumn("sum(tpch.lineitem.l_extendedprice)");
c4->alias("sum_base_price");
returnedColumnList.push_back(c4);
ArithmeticColumn *c5 = new ArithmeticColumn("sum(tpch.lineitem.l_extendedprice * (1 - tpch.lineitem.l_discount))");
ArithmeticColumn* c5 = new ArithmeticColumn("sum(tpch.lineitem.l_extendedprice * (1 - tpch.lineitem.l_discount))");
c5->alias("sum_disc_price");
returnedColumnList.push_back(c5);
ArithmeticColumn *c6 = new ArithmeticColumn("avg(tpch.lineitem.l_quantity)");
ArithmeticColumn* c6 = new ArithmeticColumn("avg(tpch.lineitem.l_quantity)");
c6->alias("avg_qty");
returnedColumnList.push_back(c6);
ArithmeticColumn *c7 = new ArithmeticColumn("avg(tpch.lineitem.l_extendedprice)");
ArithmeticColumn* c7 = new ArithmeticColumn("avg(tpch.lineitem.l_extendedprice)");
c6->alias("avg_price");
returnedColumnList.push_back(c7);
ArithmeticColumn *c8 = new ArithmeticColumn("avg(tpch.lineitem.l_discount)");
ArithmeticColumn* c8 = new ArithmeticColumn("avg(tpch.lineitem.l_discount)");
c8->alias("avg_disc");
returnedColumnList.push_back(c8);
// count(*) -> count(ALL)
ArithmeticColumn *c9 = new ArithmeticColumn("count(ALL)");
ArithmeticColumn* c9 = new ArithmeticColumn("count(ALL)");
c9->alias("count_order");
returnedColumnList.push_back(c9);
csep.returnedCols(returnedColumnList);
// Filters
CalpontSelectExecutionPlan::FilterTokenList filterTokenList;
SimpleFilter *f1 = new SimpleFilter (new Operator("<="),
SimpleFilter* f1 = new SimpleFilter (new Operator("<="),
new SimpleColumn("tpch.lineitem.l_shipdate"),
new ArithmeticColumn("date('1998-12-01')"));
filterTokenList.push_back(f1);
csep.filterTokenList(filterTokenList);
csep.filterTokenList(filterTokenList);
// Group by
CalpontSelectExecutionPlan::GroupByColumnList groupByList;
SimpleColumn *g1 = new SimpleColumn(*c1);
CalpontSelectExecutionPlan::GroupByColumnList groupByList;
SimpleColumn* g1 = new SimpleColumn(*c1);
groupByList.push_back(g1);
SimpleColumn *g2 = new SimpleColumn(*c2);
SimpleColumn* g2 = new SimpleColumn(*c2);
groupByList.push_back(g2);
csep.groupByCols (groupByList);
// Order by
CalpontSelectExecutionPlan::OrderByColumnList orderByList;
SimpleColumn *o1 = new SimpleColumn(*g1);
orderByList.push_back(o1);
SimpleColumn *o2 = new SimpleColumn(*g2);
orderByList.push_back(o2);
csep.groupByCols (groupByList);
// Order by
CalpontSelectExecutionPlan::OrderByColumnList orderByList;
SimpleColumn* o1 = new SimpleColumn(*g1);
orderByList.push_back(o1);
SimpleColumn* o2 = new SimpleColumn(*g2);
orderByList.push_back(o2);
csep.orderByCols(orderByList);
cout << csep;
}
};
cout << csep;
}
};
CPPUNIT_TEST_SUITE_REGISTRATION( TPCH_EXECPLAN );
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/ui/text/TestRunner.h>
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);
}