Skip to content

Commit

Permalink
test(f24-p3): modify mock graph table (#765)
Browse files Browse the repository at this point in the history
  • Loading branch information
xx01cyx authored Oct 24, 2024
1 parent 719e735 commit 613c0f5
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/execution/mock_scan_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ auto GetMockTableSchemaOf(const std::string &table) -> Schema {
}

if (table == "__mock_graph") {
// Note(f24): Make `src_label` and `dst_label` INTEGER because the current external merge sort implementation
// only supports sorting on fixed-length data. Should be VARCHAR(8) if var-length data sorting is supported in
// the future.
return Schema{std::vector{Column{"src", TypeId::INTEGER}, Column{"dst", TypeId::INTEGER},
Column{"src_label", TypeId::VARCHAR, 8}, Column{"dst_label", TypeId::VARCHAR, 8},
Column{"src_label", TypeId::INTEGER}, Column{"dst_label", TypeId::INTEGER},
Column{"distance", TypeId::INTEGER}}};
}

Expand Down Expand Up @@ -433,8 +436,9 @@ auto GetFunctionOf(const MockScanPlanNode *plan) -> std::function<Tuple(size_t)>
int dst = cursor / GRAPH_NODE_CNT;
values.push_back(ValueFactory::GetIntegerValue(src));
values.push_back(ValueFactory::GetIntegerValue(dst));
values.push_back(ValueFactory::GetVarcharValue(fmt::format("{:03}", src)));
values.push_back(ValueFactory::GetVarcharValue(fmt::format("{:03}", dst)));
// Note(f24): Use INTEGER for `src_label` and `dst_label` based on current external merge sort.
values.push_back(ValueFactory::GetIntegerValue(src * 100));
values.push_back(ValueFactory::GetIntegerValue(dst * 100));
if (src == dst) {
values.push_back(ValueFactory::GetNullValueByType(TypeId::INTEGER));
} else {
Expand Down

0 comments on commit 613c0f5

Please sign in to comment.