refactor: support dynamic params for CALL procedure - #732
Conversation
Allow CALL/GDS exec paths to observe query parameters so options and predicates can later resolve dynamic params at runtime.
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.
Refactors CALL and GDS execution paths to pass through ParamsMap so procedure/algorithm execution can observe query parameters at runtime.
Changes:
- Extends
call_exec_func_t/execFuncsignature to acceptconst execution::ParamsMap&. - Threads
paramsthrough procedure call and GDS operator evaluation to function execution. - Updates built-in and extension functions (pattern matching + GDS algos) to accept the new parameter.
Reviewed changes
Copilot reviewed 24 out of 24 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/execution/execute/ops/retrieve/procedure_call.cc | Passes params into execFunc for procedure calls. |
| src/execution/execute/ops/retrieve/gds_algo.cc | Passes params into execFunc for GDS operator execution. |
| src/compiler/function/show_loaded_extensions_function.cpp | Updates function lambda signature to accept ParamsMap. |
| src/compiler/function/gds/project_graph_function.cpp | Updates multiple GDS admin function lambdas for new execFunc signature. |
| include/neug/compiler/function/neug_call_function.h | Updates call_exec_func_t signature and includes params_map.h. |
| extension/pattern_matching/src/pattern_matching_functions.cpp | Updates extension function lambdas to accept ParamsMap. |
| extension/gds/src/wcc.cc | Updates GDS WCC exec signature to accept ParamsMap. |
| extension/gds/src/sssp.cc | Updates GDS SSSP exec signature to accept ParamsMap. |
| extension/gds/src/page_rank.cc | Updates GDS PageRank exec signature to accept ParamsMap. |
| extension/gds/src/louvain.cc | Updates GDS Louvain exec signature to accept ParamsMap. |
| extension/gds/src/leiden.cc | Updates GDS Leiden exec signature to accept ParamsMap. |
| extension/gds/src/lcc.cc | Updates GDS LCC exec signature to accept ParamsMap. |
| extension/gds/src/kcore.cc | Updates GDS KCore exec signature to accept ParamsMap. |
| extension/gds/src/cdlp.cc | Updates GDS CDLP exec signature to accept ParamsMap. |
| extension/gds/src/bfs.cc | Updates GDS BFS exec signature to accept ParamsMap. |
| extension/gds/include/wcc.h | Updates WCC header declaration for new exec signature. |
| extension/gds/include/sssp.h | Updates SSSP header declaration for new exec signature. |
| extension/gds/include/page_rank.h | Updates PageRank header declaration for new exec signature. |
| extension/gds/include/louvain.h | Updates Louvain header declaration for new exec signature. |
| extension/gds/include/leiden.h | Updates Leiden header declaration for new exec signature. |
| extension/gds/include/lcc.h | Updates LCC header declaration for new exec signature. |
| extension/gds/include/kcore.h | Updates KCore header declaration for new exec signature. |
| extension/gds/include/cdlp.h | Updates CDLP header declaration for new exec signature. |
| extension/gds/include/bfs.h | Updates BFS header declaration for new exec signature. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use [[maybe_unused]] ParamsMap& so clang-format keeps a readable pointer style instead of splitting ParamsMap & across lines. Co-authored-by: Cursor <cursoragent@cursor.com>
| using call_exec_func_t = std::function<execution::Context( | ||
| const CallFuncInputBase& input, neug::IStorageInterface& graph)>; | ||
| const CallFuncInputBase& input, neug::IStorageInterface& graph, | ||
| const execution::ParamsMap& params)>; |
There was a problem hiding this comment.
我感觉现在大部分function都没用到这个 params,可不可以单独搞一个类提供带 params 的 exec function?
There was a problem hiding this comment.
目前是没用到这个params字段, 但它和 IStorageInterface是一样的,属于运行时上下文,单独拆一个带 params 的类/接口会让 procedure_call / gds_algo 需要分发,逻辑会复杂些,感觉是否统一下会好些?
There was a problem hiding this comment.
主要感觉现在大部分function都没用到这个params,如果真的传了params,现在的行为是什么呢?
Preserve $param names on ProcedureCall arguments and add a unittest that resolves them from ParamsMap at exec time. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Drop ParamsMap from execFunc; operators call evaluateParams first so CALL args can carry typed Value literals or deferred param names. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
$paramnames onProcedureCallarguments (Argument.param_name) instead of requiring bind-time literals.CallFuncInputBase::bindParams(ParamsMap)beforeexecFuncruns (noParamsMaponexecFunc).CALL TEST_ECHO_PARAM($param)with typedValueliterals / deferred params.Closes #731