Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion algo/src/function/gds_node2vec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,
function_set GDSNode2VecFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(GDSNode2VecFunction::name,
std::vector<LogicalTypeID>{LogicalTypeID::ANY});
std::vector<LogicalTypeID>{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/k_core_decomposition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,
function_set KCoreDecompositionFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(KCoreDecompositionFunction::name,
std::vector<LogicalTypeID>{LogicalTypeID::ANY});
std::vector<LogicalTypeID>{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/louvain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,

function_set LouvainFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::ANY});
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/page_rank.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,
function_set PageRankFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(PageRankFunction::name,
std::vector<LogicalTypeID>{LogicalTypeID::ANY});
std::vector<LogicalTypeID>{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/spanning_forest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ static void getLogicalPlan(Planner* planner, const BoundReadingClause& readingCl

function_set SpanningForest::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::ANY});
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/strongly_connected_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,
function_set SCCFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(SCCFunction::name,
std::vector<LogicalTypeID>{LogicalTypeID::ANY});
std::vector<LogicalTypeID>{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/strongly_connected_components_kosaraju.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,

function_set SCCKosarajuFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::ANY});
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
3 changes: 2 additions & 1 deletion algo/src/function/weakly_connected_components.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ static std::unique_ptr<TableFuncBindData> bindFunc(main::ClientContext* context,

function_set WeaklyConnectedComponentsFunction::getFunctionSet() {
function_set result;
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::ANY});
auto func = std::make_unique<TableFunction>(name, std::vector{LogicalTypeID::STRING});
func->parameterNames = {"graph_name"};
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = GDSFunction::initSharedState;
Expand Down
26 changes: 24 additions & 2 deletions algo/src/include/function/gds_algo_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -198,11 +198,33 @@ struct GDSPerNodeScalarAlgo {

static function::function_set getFunctionSet() {
function::function_set result;
std::vector<common::LogicalTypeID> inputTypes{common::LogicalTypeID::ANY};
std::vector<common::LogicalTypeID> inputTypes{common::LogicalTypeID::STRING};
std::vector<std::string> paramNames{"graph_name"};
// LogicalType is explicitly-copyable only (private copy ctor): build via moves,
// not an initializer list (which would copy).
std::vector<common::LogicalType> paramTypes;
paramTypes.reserve(1 + DESC::Extra::NUM_ARGS);
paramTypes.push_back(common::LogicalType::STRING());
for (auto i = 0u; i < DESC::Extra::NUM_ARGS; ++i) {
inputTypes.push_back(common::LogicalTypeID::ANY);
// Extra args are lists of node rowids (see SourceListArg::bind).
inputTypes.push_back(common::LogicalTypeID::LIST);
paramNames.emplace_back("sources");
paramTypes.push_back(common::LogicalType::LIST(common::LogicalType::INT64()));
}
auto func = std::make_unique<function::TableFunction>(std::string{DESC::name}, inputTypes);
if constexpr (DESC::Extra::NUM_ARGS > 0) {
// Extra args are nested types (SOURCE_LIST's LIST(INT64)). The binder builds
// input LogicalTypes from the declared LogicalTypeIDs, and a bare LIST ID has
// no child info — infer the nested type from the CALL-site argument instead.
func->inferInputTypes = [](const binder::expression_vector& params) {
std::vector<common::LogicalType> types;
types.push_back(common::LogicalType::STRING());
types.push_back(params[1]->getDataType().copy());
return types;
};
}
func->parameterNames = std::move(paramNames);
func->parameterTypes = std::move(paramTypes);
func->bindFunc = bindFunc;
func->tableFunc = tableFunc;
func->initSharedStateFunc = function::GDSFunction::initSharedState;
Expand Down
Loading