Skip to content

Commit 32d7085

Browse files
authored
feat(f24-p3): add new mock tables (#761)
* feat: add new mock tables * remove unused comments
1 parent d5f7943 commit 32d7085

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

src/execution/mock_scan_executor.cpp

+44-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ static const char *ta_list_2023_fall[] = {"skyzh", "yliang412", "ferna
3636
static const char *ta_list_2024[] = {"AlSchlo", "walkingcabbages", "averyqi115", "lanlou1554", "sweetsuro",
3737
"ChaosZhai", "SDTheSlayer", "xx01cyx", "yliang412", "thelongmarch-azx"};
3838

39+
static const char *ta_list_2024_fall[] = {"17zhangw", "connortsui20", "J-HowHuang", "lanlou1554",
40+
"prashanthduvvada", "unw9527", "xx01cyx", "yashkothari42"};
41+
3942
static const char *ta_oh_2022[] = {"Tuesday", "Wednesday", "Monday", "Wednesday", "Thursday", "Friday",
4043
"Wednesday", "Randomly", "Tuesday", "Monday", "Tuesday"};
4144

@@ -48,11 +51,15 @@ static const char *ta_oh_2023_fall[] = {"Randomly", "Tuesday", "Wednesday", "T
4851
static const char *ta_oh_2024[] = {"Friday", "Thursday", "Friday", "Wednesday", "Thursday",
4952
"Yesterday", "Monday", "Tuesday", "Tuesday", "Monday"};
5053

54+
static const char *ta_oh_2024_fall[] = {"Wednesday", "Thursday", "Tuesday", "Monday",
55+
"Friday", "Thursday", "Tuesday", "Friday"};
56+
5157
static const char *course_on_date[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
5258

5359
const char *mock_table_list[] = {"__mock_table_1", "__mock_table_2", "__mock_table_3", "__mock_table_tas_2022",
5460
"__mock_table_tas_2023", "__mock_table_tas_2023_fall", "__mock_table_tas_2024",
55-
"__mock_agg_input_small", "__mock_agg_input_big", "__mock_table_schedule_2022",
61+
"__mock_table_tas_2024_fall", "__mock_agg_input_small", "__mock_agg_input_big",
62+
"__mock_external_merge_sort_input", "__mock_table_schedule_2022",
5663
"__mock_table_schedule", "__mock_table_123", "__mock_graph",
5764
// For leaderboard Q1
5865
"__mock_t1",
@@ -94,6 +101,10 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema {
94101
return Schema{std::vector{Column{"github_id", TypeId::VARCHAR, 128}, Column{"office_hour", TypeId::VARCHAR, 128}}};
95102
}
96103

104+
if (table == "__mock_table_tas_2024_fall") {
105+
return Schema{std::vector{Column{"github_id", TypeId::VARCHAR, 128}, Column{"office_hour", TypeId::VARCHAR, 128}}};
106+
}
107+
97108
if (table == "__mock_table_schedule_2022") {
98109
return Schema{std::vector{Column{"day_of_week", TypeId::VARCHAR, 128}, Column{"has_lecture", TypeId::INTEGER}}};
99110
}
@@ -108,6 +119,11 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema {
108119
Column{"v5", TypeId::INTEGER}, Column{"v6", TypeId::VARCHAR, 128}}};
109120
}
110121

122+
if (table == "__mock_external_merge_sort_input") {
123+
return Schema{
124+
std::vector{Column{"v1", TypeId::INTEGER}, Column{"v2", TypeId::INTEGER}, Column{"v3", TypeId::INTEGER}}};
125+
}
126+
111127
if (table == "__mock_graph") {
112128
return Schema{std::vector{Column{"src", TypeId::INTEGER}, Column{"dst", TypeId::INTEGER},
113129
Column{"src_label", TypeId::VARCHAR, 8}, Column{"dst_label", TypeId::VARCHAR, 8},
@@ -182,6 +198,10 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t {
182198
return sizeof(ta_list_2024) / sizeof(ta_list_2024[0]);
183199
}
184200

201+
if (table == "__mock_table_tas_2024_fall") {
202+
return sizeof(ta_list_2024_fall) / sizeof(ta_list_2024_fall[0]);
203+
}
204+
185205
if (table == "__mock_table_schedule_2022") {
186206
return sizeof(course_on_date) / sizeof(course_on_date[0]);
187207
}
@@ -198,6 +218,10 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t {
198218
return 10000;
199219
}
200220

221+
if (table == "__mock_external_merge_sort_input") {
222+
return 100000;
223+
}
224+
201225
if (table == "__mock_graph") {
202226
return GRAPH_NODE_CNT * GRAPH_NODE_CNT;
203227
}
@@ -329,6 +353,15 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function<Tuple(size_t)>
329353
};
330354
}
331355

356+
if (table == "__mock_table_tas_2024_fall") {
357+
return [plan](size_t cursor) {
358+
std::vector<Value> values{};
359+
values.push_back(ValueFactory::GetVarcharValue(ta_list_2024_fall[cursor]));
360+
values.push_back(ValueFactory::GetVarcharValue(ta_oh_2024_fall[cursor]));
361+
return Tuple{values, &plan->OutputSchema()};
362+
};
363+
}
364+
332365
if (table == "__mock_table_schedule_2022") {
333366
return [plan](size_t cursor) {
334367
std::vector<Value> values{};
@@ -375,6 +408,16 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function<Tuple(size_t)>
375408
};
376409
}
377410

411+
if (table == "__mock_external_merge_sort_input") {
412+
return [plan](size_t cursor) {
413+
std::vector<Value> values{};
414+
values.push_back(ValueFactory::GetIntegerValue(cursor));
415+
values.push_back(ValueFactory::GetIntegerValue((cursor + 1777) % 15000));
416+
values.push_back(ValueFactory::GetIntegerValue((cursor + 3) % 111));
417+
return Tuple{values, &plan->OutputSchema()};
418+
};
419+
}
420+
378421
if (table == "__mock_table_123") {
379422
return [plan](size_t cursor) {
380423
std::vector<Value> values{};

0 commit comments

Comments
 (0)