Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(interactive): Introduce call_proc as a new physical operator and implement it #4288

Merged
merged 21 commits into from
Oct 22, 2024

Conversation

zhanglei1949
Copy link
Collaborator

@zhanglei1949 zhanglei1949 commented Oct 14, 2024

Currently have too kinds graph queries. One is adhoc query, the other is call_proc query. We provide two different route and APIs for these two kind of queries, but it is possible to merge call_proc query into adhoc query, as an operator.

In this PR, we Introduce a CALL_PROCEDURE operator into PhysicalPlan proto. So, we could remove the /v1/graph/{id}/query from compiler side. However, we still need the API in server side, for SDK to use.

TODO

  • Revisit the dependency introduce by procedure_call.cc, including get app_base, and get session. Ideally, we shoud not only involve interfaces of ReadTransaction. -> Negative
  • Make sure the introduce of StdStringValue is necessary. -> Removed.
  • Finish all if-else check in procedure_call.cc.
  • We need to call the procedure for each record. Could we optimize? -> Negative

User now could embed the call_proc in a cypher query, for example

MATCH(p: person) with p.id as oid CALL k_neighbors("person", oid, 1) return label_name, vertex_oid;

where k_neighbors is a builtin procedure.

Fixes #4278

@zhanglei1949 zhanglei1949 marked this pull request as draft October 14, 2024 03:37

This comment was marked as resolved.

@zhanglei1949 zhanglei1949 changed the title [WIP] Verify call proc op refactor(interactive): Introduce call_proc as a new physical operator and implement it Oct 15, 2024
Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 requested a review from liulx20 October 15, 2024 07:44
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
const physical::ProcedureCall& opr,
const ReadTransaction& txn,
Context&& ctx) {
auto& query = opr.query();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How should we fetch the procedure's handler here?

Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 marked this pull request as ready for review October 18, 2024 02:31
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Copy link
Contributor

github-actions bot commented Oct 18, 2024

Please check the preview of the documentation changes at
https://ff5bc3a5.graphscope-docs-preview.pages.dev

@codecov-commenter
Copy link

codecov-commenter commented Oct 21, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 36.96%. Comparing base (0aa119e) to head (1540635).
Report is 4 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #4288   +/-   ##
=======================================
  Coverage   36.96%   36.96%           
=======================================
  Files         126      126           
  Lines       13235    13235           
=======================================
  Hits         4892     4892           
  Misses       8343     8343           

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0aa119e...1540635. Read the comment docs.

Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
Committed-by: xiaolei.zl from Dev container
@zhanglei1949 zhanglei1949 merged commit 6aa557c into alibaba:main Oct 22, 2024
25 of 27 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.

Make call_proc another operator in physical plan
6 participants