@@ -53,7 +53,9 @@ const char *mock_table_list[] = {"__mock_table_1", "__mock_table_2", "__mock_tab
53
53
// For leaderboard Q2
54
54
" __mock_t4_1m" , " __mock_t5_1m" , " __mock_t6_1m" ,
55
55
// For leaderboard Q3
56
- " __mock_t7" , " __mock_t8" , " __mock_t9" , nullptr };
56
+ " __mock_t7" , " __mock_t8" , " __mock_t9" ,
57
+ // For P3 leaderboard Q4
58
+ " __mock_t10" , " __mock_t11" , nullptr };
57
59
58
60
static const int GRAPH_NODE_CNT = 10 ;
59
61
@@ -128,6 +130,14 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema {
128
130
return Schema{std::vector{Column{" x" , TypeId::INTEGER}, Column{" y" , TypeId::INTEGER}}};
129
131
}
130
132
133
+ if (table == " __mock_t10" ) {
134
+ return Schema{std::vector{Column{" x" , TypeId::INTEGER}, Column{" y" , TypeId::INTEGER}}};
135
+ }
136
+
137
+ if (table == " __mock_t11" ) {
138
+ return Schema{std::vector{Column{" x" , TypeId::INTEGER}, Column{" y" , TypeId::INTEGER}}};
139
+ }
140
+
131
141
throw bustub::Exception (fmt::format (" mock table {} not found" , table));
132
142
}
133
143
@@ -202,6 +212,14 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t {
202
212
return 10000000 ;
203
213
}
204
214
215
+ if (table == " __mock_t10" ) {
216
+ return 10000 ; // 10k
217
+ }
218
+
219
+ if (table == " __mock_t11" ) {
220
+ return 1000000 ; // 1M
221
+ }
222
+
205
223
return 0 ;
206
224
}
207
225
@@ -428,6 +446,24 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function<Tuple(size_t)>
428
446
};
429
447
}
430
448
449
+ if (table == " __mock_t10" ) {
450
+ return [plan](size_t cursor) {
451
+ std::vector<Value> values{};
452
+ values.push_back (ValueFactory::GetIntegerValue (cursor));
453
+ values.push_back (ValueFactory::GetIntegerValue (cursor * 10 ));
454
+ return Tuple{values, &plan->OutputSchema ()};
455
+ };
456
+ }
457
+
458
+ if (table == " __mock_t11" ) {
459
+ return [plan](size_t cursor) {
460
+ std::vector<Value> values{};
461
+ values.push_back (ValueFactory::GetIntegerValue (-1 * (cursor % 1000 ) - 1 ));
462
+ values.push_back (ValueFactory::GetIntegerValue (cursor * 10 ));
463
+ return Tuple{values, &plan->OutputSchema ()};
464
+ };
465
+ }
466
+
431
467
// By default, return table of all 0.
432
468
return [plan](size_t cursor) {
433
469
std::vector<Value> values{};
0 commit comments