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

[BUG] Unexpected ExpandE and GetV fusion #3732

Closed
BingqingLyu opened this issue Apr 22, 2024 · 1 comment · Fixed by #3804
Closed

[BUG] Unexpected ExpandE and GetV fusion #3732

BingqingLyu opened this issue Apr 22, 2024 · 1 comment · Fixed by #3804
Assignees
Labels

Comments

@BingqingLyu
Copy link
Collaborator

Describe the bug

Currently in the new compilation stack, we will fused EdgeExpand and GetVertex when the edges output by EdgeExpand is not necessary. However, this may occur a bug in the following query on LDBC:

MATCH (friend:PERSON)<-[:HASCREATOR]-(comment:COMMENT)
Return count(friend)

In this case, EdgeExpand(type=HASCREATOR, OPT=EDGE) and GetV(type=COMMENT, OPT=SRCV) are fused into EdgeExpand(type=HASCREATOR, OPT=VERTEX), while the fused edge expansion actually expands HASCREATOR-COMMENT and HASCREATOR-POST, and it is not as expected.

This should fixed by defining edge type as a triplet (instead of a single type_id).

Copy link
Contributor

/cc @BingqingLyu, this issus/pr has had no activity for for a long time, could you folks help to review the status ?
To suppress further notifications,

  • for issues,
    • if it is waiting for further response from the reporter/author, please help to add the label requires-further-info,
    • if you have already started working on it, please add the label work-in-progress to the issue,
    • if this issue requires further designing discussion and not in current plan, or won't be fixed, please add the label requires-further-discussion or wontfix to the issue,
  • for pull requests,
    • if you are still working on it and it is not ready for reviewing, please convert this pull request as draft PR,
    • if you have decided to hold this development on, please add the requires-further-discussion label to the pull request.
      Thanks!

siyuan0322 pushed a commit that referenced this issue May 20, 2024
…n `GetV` has imprecise types (#3804)

<!--
Thanks for your contribution! please review
https://github.com/alibaba/GraphScope/blob/main/CONTRIBUTING.md before
opening an issue.
-->

## What do these changes do?

<!-- Please give a short brief about these changes. -->

As titled. This pr:
1. Fix a bug in `ExpandGetVFusionRule`. For example, assume we have edge
types of `person-likes-comment`, `person-likes-post`,
`person-knows-person` in schema. Then in queries, if we want to expand
`person-likes-comment`, we would generate a
`Expand(likes)+GetV(comment)` (before this fix, we generate a
`Expand(likes)` only, which is a bug); And if we want to expand
`person-knows-person`, we simply generate a `Expand(knows)`.
2. Optimize cases when the types in GetV is imprecise, to avoid
unnecessary filtering in Runtime.

## Related issue number

<!-- Are there any issues opened that will be resolved by merging this
change? -->

Fixes #3732 #3802

---------

Co-authored-by: Xiaoli Zhou <yihe.zxl@alibaba-inc.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant