Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit b1cc1a4

Browse files
schedutrontcm-marcel
authored andcommitted
Fix scattered discrepencies
1 parent 353e31d commit b1cc1a4

31 files changed

+150
-149
lines changed

test/binder/binder_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ namespace test {
3939

4040
class BinderCorrectnessTests : public PelotonTests {
4141
virtual void SetUp() override {
42-
PelotonTest::SetUp();
42+
PelotonTests::SetUp();
4343
catalog::Catalog::GetInstance();
4444
// NOTE: Catalog::GetInstance()->Bootstrap(), you can only call it once!
4545
TestingExecutorUtil::InitializeDatabase(DEFAULT_DB_NAME);
4646
}
4747

4848
virtual void TearDown() override {
4949
TestingExecutorUtil::DeleteDatabase(DEFAULT_DB_NAME);
50-
PelotonTest::TearDown();
50+
PelotonTests::TearDown();
5151
}
5252
};
5353

test/catalog/tuple_schema_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ TEST_F(TupleSchemaTests, ColumnInfoTest) {
4545
}
4646

4747
/*
48-
* TupleSchemaFilteringTest() - Tests FilterSchema() which uses a set
48+
* TupleSchemaFilteringTests() - Tests FilterSchema() which uses a set
4949
*/
5050
TEST_F(TupleSchemaTests, TupleSchemaFilteringTest) {
5151
std::vector<catalog::Column> columns;
@@ -115,7 +115,7 @@ TEST_F(TupleSchemaTests, TupleSchemaFilteringTest) {
115115
}
116116

117117
/*
118-
* TupleSchemaCopyTest() - Tests CopySchema() which uses a list of indices
118+
* TupleSchemaCopyTests() - Tests CopySchema() which uses a list of indices
119119
*/
120120
TEST_F(TupleSchemaTests, TupleSchemaCopyTest) {
121121
std::vector<catalog::Column> columns;

test/codegen/block_nested_loop_join_translator_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ namespace test {
2323

2424
class BlockNestedLoopJoinTranslatorTests : public PelotonCodeGenTests {
2525
public:
26-
BlockNestedLoopJoinTranslatorTest() : PelotonCodeGenTest() {
26+
BlockNestedLoopJoinTranslatorTests() : PelotonCodeGenTests() {
2727
// Load the test table
2828
uint32_t num_rows = 10;
2929
LoadTestTable(LeftTableId(), 2 * num_rows);
@@ -59,7 +59,7 @@ class BlockNestedLoopJoinTranslatorTests : public PelotonCodeGenTests {
5959
type::Value GetCol(const AbstractTuple &t, JoinOutputColPos p);
6060
};
6161

62-
void BlockNestedLoopJoinTranslatorTest::PerformTest(
62+
void BlockNestedLoopJoinTranslatorTests::PerformTest(
6363
ExpressionPtr &&predicate, const std::vector<oid_t> &left_join_cols,
6464
const std::vector<oid_t> &right_join_cols,
6565
std::vector<codegen::WrappedTuple> &results) {
@@ -102,8 +102,8 @@ void BlockNestedLoopJoinTranslatorTest::PerformTest(
102102
results = buffer.GetOutputTuples();
103103
}
104104

105-
type::Value BlockNestedLoopJoinTranslatorTest::GetCol(const AbstractTuple &t,
106-
JoinOutputColPos p) {
105+
type::Value BlockNestedLoopJoinTranslatorTests::GetCol(const AbstractTuple &t,
106+
JoinOutputColPos p) {
107107
return t.GetValue(static_cast<oid_t>(p));
108108
}
109109

test/codegen/bloom_filter_test.cpp

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,15 @@ namespace test {
3838

3939
class BloomFilterCodegenTests : public PelotonTests {
4040
public:
41-
BloomFilterCodegenTest() {
41+
BloomFilterCodegenTests() {
4242
// Create test db
4343
auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
4444
auto txn = txn_manager.BeginTransaction();
4545
catalog::Catalog::GetInstance()->CreateDatabase(DEFAULT_DB_NAME, txn);
4646
txn_manager.CommitTransaction(txn);
4747
}
4848

49-
~BloomFilterCodegenTest() {
49+
~BloomFilterCodegenTests() {
5050
// Drop test db
5151
auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
5252
auto txn = txn_manager.BeginTransaction();
@@ -276,11 +276,9 @@ TEST_F(BloomFilterCodegenTests, PerformanceTest) {
276276
txn_manager.CommitTransaction(txn);
277277
}
278278

279-
double BloomFilterCodegenTest::ExecuteJoin(std::string query,
280-
concurrency::TransactionContext *txn,
281-
int num_iter,
282-
unsigned inner_table_cardinality,
283-
bool enable_bloom_filter) {
279+
double BloomFilterCodegenTests::ExecuteJoin(
280+
std::string query, concurrency::TransactionContext *txn, int num_iter,
281+
unsigned inner_table_cardinality, bool enable_bloom_filter) {
284282
std::unique_ptr<optimizer::AbstractOptimizer> optimizer(
285283
new optimizer::Optimizer());
286284
double total_runtime = 0;
@@ -310,8 +308,8 @@ double BloomFilterCodegenTest::ExecuteJoin(std::string query,
310308
*plan, executor_context->GetParams().GetQueryParametersMap(), consumer);
311309

312310
// Run
313-
PelotonCodeGenTest::ExecuteSync(*compiled_query,
314-
std::move(executor_context), consumer);
311+
PelotonCodeGenTests::ExecuteSync(*compiled_query,
312+
std::move(executor_context), consumer);
315313

316314
LOG_INFO("Execution Time: %0.0f ms", stats.plan_ms);
317315
total_runtime += stats.plan_ms;
@@ -321,8 +319,9 @@ double BloomFilterCodegenTest::ExecuteJoin(std::string query,
321319

322320
// Create a table where all the columns are BIGINT and each tuple has desired
323321
// tuple size
324-
void BloomFilterCodegenTest::CreateTable(std::string table_name, int tuple_size,
325-
concurrency::TransactionContext *txn) {
322+
void BloomFilterCodegenTests::CreateTable(
323+
std::string table_name, int tuple_size,
324+
concurrency::TransactionContext *txn) {
326325
int curr_size = 0;
327326
size_t bigint_size = type::Type::GetTypeSize(type::TypeId::BIGINT);
328327
std::vector<catalog::Column> cols;
@@ -339,9 +338,9 @@ void BloomFilterCodegenTest::CreateTable(std::string table_name, int tuple_size,
339338
}
340339

341340
// Insert a tuple to specific table
342-
void BloomFilterCodegenTest::InsertTuple(const std::vector<int> &vals,
343-
storage::DataTable *table,
344-
concurrency::TransactionContext *txn) {
341+
void BloomFilterCodegenTests::InsertTuple(
342+
const std::vector<int> &vals, storage::DataTable *table,
343+
concurrency::TransactionContext *txn) {
345344
auto &txn_manager = concurrency::TransactionManagerFactory::GetInstance();
346345
storage::Tuple tuple{table->GetSchema(), true};
347346
for (unsigned i = 0; i < vals.size(); i++) {

test/codegen/case_translator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace test {
2727

2828
class CaseTranslatorTests : public PelotonCodeGenTests {
2929
public:
30-
CaseTranslatorTest() : PelotonCodeGenTest(), num_rows_to_insert(64) {
30+
CaseTranslatorTests() : PelotonCodeGenTests(), num_rows_to_insert(64) {
3131
// Load test table
3232
LoadTestTable(TestTableId(), num_rows_to_insert);
3333
}

test/codegen/delete_translator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ namespace test {
2525

2626
class DeleteTranslatorTests : public PelotonCodeGenTests {
2727
public:
28-
DeleteTranslatorTest() : PelotonCodeGenTest() {}
28+
DeleteTranslatorTests() : PelotonCodeGenTests() {}
2929

3030
size_t GetCurrentTableSize(oid_t table_id) {
3131
planner::SeqScanPlan scan{&GetTestTable(table_id), nullptr, {0, 1}};

test/codegen/group_by_translator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace test {
2727

2828
class GroupByTranslatorTests : public PelotonCodeGenTests {
2929
public:
30-
GroupByTranslatorTest() : PelotonCodeGenTest() {
30+
GroupByTranslatorTests() : PelotonCodeGenTests() {
3131
uint32_t num_rows = 10;
3232
LoadTestTable(TestTableId(), num_rows);
3333
}

test/codegen/hash_join_translator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ namespace test {
2727

2828
class HashJoinTranslatorTests : public PelotonCodeGenTests {
2929
public:
30-
HashJoinTranslatorTest() : PelotonCodeGenTest() {
30+
HashJoinTranslatorTests() : PelotonCodeGenTests() {
3131
// Load the test table
3232
uint32_t num_rows = 10;
3333
LoadTestTable(LeftTableId(), 2 * num_rows);

test/codegen/insert_translator_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ namespace test {
2424

2525
class InsertTranslatorTests : public PelotonCodeGenTests {
2626
public:
27-
InsertTranslatorTest() : PelotonCodeGenTest() {}
27+
InsertTranslatorTests() : PelotonCodeGenTests() {}
2828
oid_t TestTableId1() { return test_table_oids[0]; }
2929
oid_t TestTableId2() { return test_table_oids[1]; }
3030
};

test/codegen/oa_hash_table_test.cpp

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ class OAHashTableTests : public PelotonTests {
4242
bool operator!=(const Value &rhs) const { return !(rhs == *this); }
4343
};
4444

45-
OAHashTableTest() {
45+
OAHashTableTests() {
4646
PELOTON_MEMSET(raw_hash_table, 1, sizeof(raw_hash_table));
4747
GetHashTable().Init(sizeof(Key), sizeof(Value));
4848
}
4949

50-
~OAHashTableTest() {
50+
~OAHashTableTests() {
5151
// Clean up
5252
GetHashTable().Destroy();
5353
}
@@ -145,67 +145,68 @@ TEST_F(OAHashTableTests, CanIterateTest) {
145145
EXPECT_EQ(3, dup_count);
146146
}
147147

148-
TEST_F(OAHashTableTests, CanCodegenProbeOrInsertTest) {
149-
TEST_F(OAHashTableTests, MicroBenchmarkTest) {
150-
uint32_t num_runs = 10;
148+
TEST_F(OAHashTableTests, CanCodegenProbeOrInsertTest) {}
151149

152-
std::vector<Key> keys;
153-
Value v = {6, 5, 4, 3};
150+
TEST_F(OAHashTableTests, MicroBenchmarkTest) {
151+
uint32_t num_runs = 10;
154152

155-
// Create all keys
156-
uint32_t num_keys = 100000;
157-
for (uint32_t i = 0; i < num_keys; i++) {
158-
keys.push_back({1, static_cast<uint32_t>(rand())});
159-
}
160-
161-
double avg_oaht = 0.0;
162-
double avg_map = 0.0;
153+
std::vector<Key> keys;
154+
Value v = {6, 5, 4, 3};
163155

164-
// First, bench ours ...
165-
{
166-
for (uint32_t b = 0; b < num_runs; b++) {
167-
Timer<std::ratio<1, 1000>> timer;
168-
timer.Start();
156+
// Create all keys
157+
uint32_t num_keys = 100000;
158+
for (uint32_t i = 0; i < num_keys; i++) {
159+
keys.push_back({1, static_cast<uint32_t>(rand())});
160+
}
169161

170-
// Start
171-
for (uint32_t i = 0; i < num_keys; i++) {
172-
Insert(keys[i], v);
173-
}
174-
// End
162+
double avg_oaht = 0.0;
163+
double avg_map = 0.0;
175164

176-
timer.Stop();
177-
avg_oaht += timer.GetDuration();
165+
// First, bench ours ...
166+
{
167+
for (uint32_t b = 0; b < num_runs; b++) {
168+
Timer<std::ratio<1, 1000>> timer;
169+
timer.Start();
178170

179-
// Reset
180-
Reset();
171+
// Start
172+
for (uint32_t i = 0; i < num_keys; i++) {
173+
Insert(keys[i], v);
181174
}
182-
}
175+
// End
183176

184-
// Next, unordered_map ...
185-
{
186-
struct Hasher {
187-
size_t operator()(const Key &k) const { return Hash(k); }
188-
};
177+
timer.Stop();
178+
avg_oaht += timer.GetDuration();
189179

190-
for (uint32_t b = 0; b < num_runs; b++) {
191-
std::unordered_map<Key, Value, Hasher> ht{
192-
codegen::util::OAHashTable::kDefaultInitialSize};
180+
// Reset
181+
Reset();
182+
}
183+
}
193184

194-
Timer<std::ratio<1, 1000>> timer;
195-
timer.Start();
185+
// Next, unordered_map ...
186+
{
187+
struct Hasher {
188+
size_t operator()(const Key &k) const { return Hash(k); }
189+
};
196190

197-
for (uint32_t i = 0; i < num_keys; i++) {
198-
ht.insert(std::make_pair(keys[i], v));
199-
}
191+
for (uint32_t b = 0; b < num_runs; b++) {
192+
std::unordered_map<Key, Value, Hasher> ht{
193+
codegen::util::OAHashTable::kDefaultInitialSize};
200194

201-
timer.Stop();
202-
avg_map += timer.GetDuration();
195+
Timer<std::ratio<1, 1000>> timer;
196+
timer.Start();
197+
198+
for (uint32_t i = 0; i < num_keys; i++) {
199+
ht.insert(std::make_pair(keys[i], v));
203200
}
204-
}
205201

206-
LOG_INFO("Avg OA_HT: %.2lf, Avg std::unordered_map: %.2lf",
207-
avg_oaht / (double)num_runs, avg_map / (double)num_runs);
202+
timer.Stop();
203+
avg_map += timer.GetDuration();
204+
}
208205
}
209206

207+
LOG_INFO("Avg OA_HT: %.2lf, Avg std::unordered_map: %.2lf",
208+
avg_oaht / (double)num_runs, avg_map / (double)num_runs);
209+
}
210+
210211
} // namespace test
211212
} // namespace peloton

0 commit comments

Comments
 (0)