Skip to content

Commit 97b3ebd

Browse files
committed
update mock executor again
Signed-off-by: Yuchen Liang <yuchenl3@andrew.cmu.edu>
1 parent 282be59 commit 97b3ebd

File tree

4 files changed

+45
-32
lines changed

4 files changed

+45
-32
lines changed

src/execution/mock_scan_executor.cpp

+30-18
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
#include "common/exception.h"
1818
#include "common/util/string_util.h"
19-
#include "execution/expressions/column_value_expression.h"
2019
#include "type/type_id.h"
2120
#include "type/value_factory.h"
2221

@@ -39,8 +38,8 @@ static const char *ta_list_2024[] = {"AlSchlo", "walkingcabbages", "averyqi115
3938
static const char *ta_list_2024_fall[] = {"17zhangw", "connortsui20", "J-HowHuang", "lanlou1554",
4039
"prashanthduvvada", "unw9527", "xx01cyx", "yashkothari42"};
4140

42-
static const char *ta_list_2025_spring[] = {"abhatna2", "aschlome", "claspias", "hyoungjk",
43-
"rboyce", "yuchenl3", "yuqixian", "jinchodi"};
41+
static const char *ta_list_2025_spring[] = {"AlSchlo", "carpecodeum", "ChrisLaspias", "hyoungjook",
42+
"joesunil123", "mrwhitezz", "rmboyce", "yliang412"};
4443

4544
static const char *ta_oh_2022[] = {"Tuesday", "Wednesday", "Monday", "Wednesday", "Thursday", "Friday",
4645
"Wednesday", "Randomly", "Tuesday", "Monday", "Tuesday"};
@@ -57,24 +56,24 @@ static const char *ta_oh_2024[] = {"Friday", "Thursday", "Friday", "Wednesda
5756
static const char *ta_oh_2024_fall[] = {"Wednesday", "Thursday", "Tuesday", "Monday",
5857
"Friday", "Thursday", "Tuesday", "Friday"};
5958

60-
static const char *ta_oh_2025_spring[] = {"Monday", "Friday", "Wednesday", "Tuesday",
61-
"Monday", "Tuesday", "Thursday", "Friday"};
59+
static const char *ta_oh_2025_spring[] = {"Friday", "Monday", "Wednesday", "Tuesday",
60+
"Friday", "Thursday", "Monday", "Tuesday"};
6261

6362
static const char *course_on_date[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"};
6463

65-
const char *mock_table_list[] = {"__mock_table_1", "__mock_table_2", "__mock_table_3", "__mock_table_tas_2022",
66-
"__mock_table_tas_2023", "__mock_table_tas_2023_fall", "__mock_table_tas_2024",
67-
"__mock_table_tas_2024_fall", "__mock_table_tas_2025_spring", "__mock_agg_input_small",
68-
"__mock_agg_input_big", "__mock_external_merge_sort_input", "__mock_table_schedule_2022",
69-
"__mock_table_schedule", "__mock_table_123", "__mock_graph",
70-
// For leaderboard Q1
71-
"__mock_t1",
72-
// For leaderboard Q2
73-
"__mock_t4_1m", "__mock_t5_1m", "__mock_t6_1m",
74-
// For leaderboard Q3
75-
"__mock_t7", "__mock_t8", "__mock_t9",
76-
// For P3 leaderboard Q4
77-
"__mock_t10", "__mock_t11", nullptr};
64+
const char *mock_table_list[] = {
65+
"__mock_table_1", "__mock_table_2", "__mock_table_3", "__mock_table_tas_2022", "__mock_table_tas_2023",
66+
"__mock_table_tas_2023_fall", "__mock_table_tas_2024", "__mock_table_tas_2024_fall", "__mock_table_tas_2025_spring",
67+
"__mock_agg_input_small", "__mock_agg_input_big", "__mock_external_merge_sort_input", "__mock_table_schedule_2022",
68+
"__mock_table_schedule", "__mock_table_123", "__mock_graph",
69+
// For leaderboard Q1
70+
"__mock_t1",
71+
// For leaderboard Q2
72+
"__mock_t4_1m", "__mock_t5_1m", "__mock_t6_1m",
73+
// For leaderboard Q3
74+
"__mock_t7", "__mock_t8", "__mock_t9",
75+
// For P3 leaderboard Q4
76+
"__mock_t10", "__mock_t11", nullptr};
7877

7978
static const int GRAPH_NODE_CNT = 10;
8079

@@ -215,6 +214,10 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t {
215214
return sizeof(ta_list_2024_fall) / sizeof(ta_list_2024_fall[0]);
216215
}
217216

217+
if (table == "__mock_table_tas_2025_spring") {
218+
return sizeof(ta_list_2025_spring) / sizeof(ta_list_2025_spring[0]);
219+
}
220+
218221
if (table == "__mock_table_schedule_2022") {
219222
return sizeof(course_on_date) / sizeof(course_on_date[0]);
220223
}
@@ -375,6 +378,15 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function<Tuple(size_t)>
375378
};
376379
}
377380

381+
if (table == "__mock_table_tas_2025_spring") {
382+
return [plan](size_t cursor) {
383+
std::vector<Value> values{};
384+
values.push_back(ValueFactory::GetVarcharValue(ta_list_2025_spring[cursor]));
385+
values.push_back(ValueFactory::GetVarcharValue(ta_oh_2025_spring[cursor]));
386+
return Tuple{values, &plan->OutputSchema()};
387+
};
388+
}
389+
378390
if (table == "__mock_table_schedule_2022") {
379391
return [plan](size_t cursor) {
380392
std::vector<Value> values{};

test/sql/p3.00-primer.slt

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
query rowsort
22
select github_id, office_hour from __mock_table_tas_2025_spring;
33
----
4-
abhatna2 Monday
5-
aschlome Friday
6-
claspias Wednesday
7-
hyoungjk Tuesday
8-
rboyce Monday
9-
yuchenl3 Tuesday
10-
yuqixian Thursday
11-
jinchodi Friday
4+
AlSchlo Friday
5+
ChrisLaspias Wednesday
6+
carpecodeum Monday
7+
hyoungjook Tuesday
8+
joesunil123 Friday
9+
mrwhitezz Thursday
10+
rmboyce Monday
11+
yliang412 Tuesday

test/sql/p3.10-simple-join.slt

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ select * from
1212
on office_hour = day_of_week
1313
where has_lecture = 1;
1414
----
15-
abhatna2 Monday Monday 1
16-
rboyce Monday Monday 1
17-
claspias Wednesday Wednesday 1
15+
ChrisLaspias Wednesday Wednesday 1
16+
carpecodeum Monday Monday 1
17+
rmboyce Monday Monday 1
1818

1919
# The real test begins...
2020

test/sql/p3.14-hash-join.slt

+4-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ select * from
99
on office_hour = day_of_week
1010
where has_lecture = 1;
1111
----
12-
abhatna2 Monday Monday 1
13-
rboyce Monday Monday 1
14-
claspias Wednesday Wednesday 1
12+
ChrisLaspias Wednesday Wednesday 1
13+
carpecodeum Monday Monday 1
14+
rmboyce Monday Monday 1
15+
1516

1617
# The real test begins...
1718

0 commit comments

Comments
 (0)