Skip to content

Commit

Permalink
Register all shortest path functions for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
SiberiaWolfP committed Feb 29, 2024
1 parent 49c957f commit ded74bd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 21 deletions.
20 changes: 10 additions & 10 deletions duckpgq/src/duckpgq/functions/scalar/iterativelength_two_phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,15 +232,15 @@ static void IterativeLengthLowerBoundFunction(DataChunk &args, ExpressionState &
duckpgq_state->csr_to_delete.insert(info.csr_id);
}

// CreateScalarFunctionInfo
// DuckPGQFunctions::GetIterativeLengthLowerBoundFunction() {
// auto fun = ScalarFunction(
// "iterativelength_lowerbound",
// {LogicalType::INTEGER, LogicalType::BIGINT, LogicalType::BIGINT,
// LogicalType::BIGINT, LogicalType::BIGINT, LogicalType::BIGINT},
// LogicalType::BIGINT, IterativeLengthLowerBoundFunction,
// IterativeLengthFunctionData::IterativeLengthBind);
// return CreateScalarFunctionInfo(fun);
// }
CreateScalarFunctionInfo
DuckPGQFunctions::GetIterativeLengthLowerBoundFunction() {
auto fun = ScalarFunction(
"iterativelength_two_phase",
{LogicalType::INTEGER, LogicalType::BIGINT, LogicalType::BIGINT,
LogicalType::BIGINT, LogicalType::BIGINT, LogicalType::BIGINT},
LogicalType::BIGINT, IterativeLengthLowerBoundFunction,
IterativeLengthFunctionData::IterativeLengthBind);
return CreateScalarFunctionInfo(fun);
}

} // namespace duckdb
23 changes: 12 additions & 11 deletions duckpgq/src/duckpgq/functions/scalar/shortest_path_two_phase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ static std::tuple<int64_t, vector<int64_t>> ShortestPathInternal(int64_t lane, i
result.push_back(destination);
result.push_back(parent_edge);
while (parent_vertex != src[search_num]) {

result.push_back(parent_vertex);
parent_edge = parents_e[parent_vertex][lane];
parent_vertex = parents_v[parent_vertex][lane];
Expand Down Expand Up @@ -318,16 +319,16 @@ static void ShortestPathLowerBoundFunction(DataChunk &args, ExpressionState &sta
duckpgq_state->csr_to_delete.insert(info.csr_id);
}

// CreateScalarFunctionInfo
// DuckPGQFunctions::GetShortestPathLowerBoundFunction() {
// auto fun = ScalarFunction(
// "shortestpath_lowerbound",
// {LogicalType::INTEGER, LogicalType::BIGINT, LogicalType::BIGINT,
// LogicalType::BIGINT, LogicalType::BIGINT, LogicalType::BIGINT},
// LogicalType::LIST(LogicalType::BIGINT),
// ShortestPathLowerBoundFunction,
// IterativeLengthFunctionData::IterativeLengthBind);
// return CreateScalarFunctionInfo(fun);
// }
CreateScalarFunctionInfo
DuckPGQFunctions::GetShortestPathLowerBoundFunction() {
auto fun = ScalarFunction(
"shortestpath_two_phase",
{LogicalType::INTEGER, LogicalType::BIGINT, LogicalType::BIGINT,
LogicalType::BIGINT, LogicalType::BIGINT, LogicalType::BIGINT},
LogicalType::LIST(LogicalType::BIGINT),
ShortestPathLowerBoundFunction,
IterativeLengthFunctionData::IterativeLengthBind);
return CreateScalarFunctionInfo(fun);
}

} // namespace duckdb

0 comments on commit ded74bd

Please sign in to comment.