From 32d70855dd3fd0a254fe71ec12152f50d36c5f16 Mon Sep 17 00:00:00 2001 From: Yuanxin Cao <60498509+xx01cyx@users.noreply.github.com> Date: Thu, 17 Oct 2024 17:52:43 -0700 Subject: [PATCH] feat(f24-p3): add new mock tables (#761) * feat: add new mock tables * remove unused comments --- src/execution/mock_scan_executor.cpp | 45 +++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/execution/mock_scan_executor.cpp b/src/execution/mock_scan_executor.cpp index 7c3ea3beb..5cc0946e4 100644 --- a/src/execution/mock_scan_executor.cpp +++ b/src/execution/mock_scan_executor.cpp @@ -36,6 +36,9 @@ static const char *ta_list_2023_fall[] = {"skyzh", "yliang412", "ferna static const char *ta_list_2024[] = {"AlSchlo", "walkingcabbages", "averyqi115", "lanlou1554", "sweetsuro", "ChaosZhai", "SDTheSlayer", "xx01cyx", "yliang412", "thelongmarch-azx"}; +static const char *ta_list_2024_fall[] = {"17zhangw", "connortsui20", "J-HowHuang", "lanlou1554", + "prashanthduvvada", "unw9527", "xx01cyx", "yashkothari42"}; + static const char *ta_oh_2022[] = {"Tuesday", "Wednesday", "Monday", "Wednesday", "Thursday", "Friday", "Wednesday", "Randomly", "Tuesday", "Monday", "Tuesday"}; @@ -48,11 +51,15 @@ static const char *ta_oh_2023_fall[] = {"Randomly", "Tuesday", "Wednesday", "T static const char *ta_oh_2024[] = {"Friday", "Thursday", "Friday", "Wednesday", "Thursday", "Yesterday", "Monday", "Tuesday", "Tuesday", "Monday"}; +static const char *ta_oh_2024_fall[] = {"Wednesday", "Thursday", "Tuesday", "Monday", + "Friday", "Thursday", "Tuesday", "Friday"}; + static const char *course_on_date[] = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; const char *mock_table_list[] = {"__mock_table_1", "__mock_table_2", "__mock_table_3", "__mock_table_tas_2022", "__mock_table_tas_2023", "__mock_table_tas_2023_fall", "__mock_table_tas_2024", - "__mock_agg_input_small", "__mock_agg_input_big", "__mock_table_schedule_2022", + "__mock_table_tas_2024_fall", "__mock_agg_input_small", "__mock_agg_input_big", + "__mock_external_merge_sort_input", "__mock_table_schedule_2022", "__mock_table_schedule", "__mock_table_123", "__mock_graph", // For leaderboard Q1 "__mock_t1", @@ -94,6 +101,10 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema { return Schema{std::vector{Column{"github_id", TypeId::VARCHAR, 128}, Column{"office_hour", TypeId::VARCHAR, 128}}}; } + if (table == "__mock_table_tas_2024_fall") { + return Schema{std::vector{Column{"github_id", TypeId::VARCHAR, 128}, Column{"office_hour", TypeId::VARCHAR, 128}}}; + } + if (table == "__mock_table_schedule_2022") { return Schema{std::vector{Column{"day_of_week", TypeId::VARCHAR, 128}, Column{"has_lecture", TypeId::INTEGER}}}; } @@ -108,6 +119,11 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema { Column{"v5", TypeId::INTEGER}, Column{"v6", TypeId::VARCHAR, 128}}}; } + if (table == "__mock_external_merge_sort_input") { + return Schema{ + std::vector{Column{"v1", TypeId::INTEGER}, Column{"v2", TypeId::INTEGER}, Column{"v3", TypeId::INTEGER}}}; + } + if (table == "__mock_graph") { return Schema{std::vector{Column{"src", TypeId::INTEGER}, Column{"dst", TypeId::INTEGER}, Column{"src_label", TypeId::VARCHAR, 8}, Column{"dst_label", TypeId::VARCHAR, 8}, @@ -182,6 +198,10 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t { return sizeof(ta_list_2024) / sizeof(ta_list_2024[0]); } + if (table == "__mock_table_tas_2024_fall") { + return sizeof(ta_list_2024_fall) / sizeof(ta_list_2024_fall[0]); + } + if (table == "__mock_table_schedule_2022") { return sizeof(course_on_date) / sizeof(course_on_date[0]); } @@ -198,6 +218,10 @@ auto GetSizeOf(const MockScanPlanNode *plan) -> size_t { return 10000; } + if (table == "__mock_external_merge_sort_input") { + return 100000; + } + if (table == "__mock_graph") { return GRAPH_NODE_CNT * GRAPH_NODE_CNT; } @@ -329,6 +353,15 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function }; } + if (table == "__mock_table_tas_2024_fall") { + return [plan](size_t cursor) { + std::vector values{}; + values.push_back(ValueFactory::GetVarcharValue(ta_list_2024_fall[cursor])); + values.push_back(ValueFactory::GetVarcharValue(ta_oh_2024_fall[cursor])); + return Tuple{values, &plan->OutputSchema()}; + }; + } + if (table == "__mock_table_schedule_2022") { return [plan](size_t cursor) { std::vector values{}; @@ -375,6 +408,16 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function }; } + if (table == "__mock_external_merge_sort_input") { + return [plan](size_t cursor) { + std::vector values{}; + values.push_back(ValueFactory::GetIntegerValue(cursor)); + values.push_back(ValueFactory::GetIntegerValue((cursor + 1777) % 15000)); + values.push_back(ValueFactory::GetIntegerValue((cursor + 3) % 111)); + return Tuple{values, &plan->OutputSchema()}; + }; + } + if (table == "__mock_table_123") { return [plan](size_t cursor) { std::vector values{};