Skip to content

refactor: support dynamic params for CALL procedure - #732

Merged
liulx20 merged 16 commits into
alibaba:mainfrom
liulx20:paramsMap
Jul 16, 2026
Merged

refactor: support dynamic params for CALL procedure#732
liulx20 merged 16 commits into
alibaba:mainfrom
liulx20:paramsMap

Conversation

@liulx20

@liulx20 liulx20 commented Jul 13, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Preserve $param names on ProcedureCall arguments (Argument.param_name) instead of requiring bind-time literals.
  • Resolve deferred CALL args in CallFuncInputBase::bindParams(ParamsMap) before execFunc runs (no ParamsMap on execFunc).
  • Add unittest covering CALL TEST_ECHO_PARAM($param) with typed Value literals / deferred params.

Closes #731

Allow CALL/GDS exec paths to observe query parameters so options and
predicates can later resolve dynamic params at runtime.
@liulx20 liulx20 changed the title feat: pass ParamsMap into NeugCallFunction execFunc refactor: pass ParamsMap into NeugCallFunction execFunc Jul 13, 2026
Co-authored-by: Cursor <cursoragent@cursor.com>
@liulx20
liulx20 requested a review from Copilot July 13, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 / execFunc signature to accept const execution::ParamsMap&.
  • Threads params through 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.

Comment thread extension/gds/include/wcc.h Outdated
Comment thread extension/pattern_matching/src/pattern_matching_functions.cpp Outdated
Comment thread include/neug/compiler/function/neug_call_function.h
Comment thread include/neug/compiler/function/neug_call_function.h Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 24 out of 24 changed files in this pull request and generated 2 comments.

Comment thread extension/gds/include/wcc.h Outdated
Comment thread include/neug/compiler/function/neug_call_function.h Outdated
@liulx20 liulx20 linked an issue Jul 14, 2026 that may be closed by this pull request
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)>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我感觉现在大部分function都没用到这个 params,可不可以单独搞一个类提供带 params 的 exec function?

@liulx20 liulx20 Jul 14, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前是没用到这个params字段, 但它和 IStorageInterface是一样的,属于运行时上下文,单独拆一个带 params 的类/接口会让 procedure_call / gds_algo 需要分发,逻辑会复杂些,感觉是否统一下会好些?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

主要感觉现在大部分function都没用到这个params,如果真的传了params,现在的行为是什么呢?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

现在行为是如果不需要就会直接忽略

liulx20 and others added 8 commits July 14, 2026 14:05
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>
@liulx20
liulx20 requested a review from shirly121 July 14, 2026 10:00
@liulx20 liulx20 changed the title refactor: pass ParamsMap into NeugCallFunction execFunc feat: resolve CALL dynamic params via CallFuncInputBase::bindParams Jul 14, 2026
@liulx20 liulx20 changed the title feat: resolve CALL dynamic params via CallFuncInputBase::bindParams feat: support dynamic params for CALL Jul 14, 2026
@liulx20 liulx20 changed the title feat: support dynamic params for CALL feat: support dynamic params for CALL procedure Jul 14, 2026
@liulx20 liulx20 changed the title feat: support dynamic params for CALL procedure refactor: support dynamic params for CALL procedure Jul 14, 2026
@liulx20
liulx20 merged commit eec0ed1 into alibaba:main Jul 16, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(extension): support dynamic parameters as CALL inputs

3 participants