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

match p=(:foo)-->() return p returns empty instead of rejecting error on not being able to pushdown #3996

Closed
wey-gu opened this issue Mar 10, 2022 · 5 comments · Fixed by #4053
Assignees
Labels
type/bug Type: something is unexpected
Milestone

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Mar 10, 2022

Could we pushdown limit in this pattern now? If not, it should be rejected, right?

In my own test on v3.0.0, it's accepted and resulting in BAD_TYPE.

(root@nebula) [amundsen]> match p=(:`User`)-->() return p limit 3
+----------+
| p        |
+----------+
| BAD_TYPE |
| BAD_TYPE |
| BAD_TYPE |
+----------+
Got 3 rows (time spent 7657/54521 us)

Thu, 10 Mar 2022 11:08:12 CST

(root@nebula) [amundsen]> match p=(n:`User`)-->() return p limit 3
[ERROR (-1005)]: Scan vertices or edges need to specify a limit number, or limit number can not push down.

Thu, 10 Mar 2022 11:08:28 CST

(root@nebula) [amundsen]> show hosts graph
+-------------+------+----------+---------+--------------+---------+
| Host        | Port | Status   | Role    | Git Info Sha | Version |
+-------------+------+----------+---------+--------------+---------+
| "127.0.0.1" | 9669 | "ONLINE" | "GRAPH" | "02b2091"    | "3.0.0" |
+-------------+------+----------+---------+--------------+---------+
Got 1 rows (time spent 1647/48999 us)

It's reported from below thread as accepted & with empty result:

ref: https://discuss.nebula-graph.com.cn/t/topic/7842/10

@wey-gu wey-gu changed the title match p=(:foo)-->() return p returns empty instead of error on not being able to pushdown match p=(:foo)-->() return p returns empty instead of rejecting error on not being able to pushdown Mar 10, 2022
@wey-gu wey-gu added the type/bug Type: something is unexpected label Mar 10, 2022
@Sophie-Xie Sophie-Xie added this to the v3.1.0 milestone Mar 10, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 10, 2022

labeled as bug for now, please kindly remove it if it's not the case ;)
Thanks!

@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 13, 2022

I am working on this.

@CPWstatic
Copy link
Contributor

I am working on this.

Looking forward to your contribution.

@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 15, 2022

It turned out:

a. p=( :foo)-->() return p resulted in Limit->AppendVertices->Project->ScanEdges ==> Limit->AppendVertices->Project->ScanEdges(Limit)

b. p=(n:foo)-->() return p resulted in Limit->AppendVertices->Project->Traverse->ScanVertices ==> cannot be pushed down

I think:

- a. should be corrected as cannot be pushed down, right? on which phase should I fix please, then? I guess the existing plan is good(to start from scanEdges rather than scanVertices), so should I fix it in ScanEdgesExecutor::scanEdges to check condition on qctx to return Error or?

update: after further look, it's found the a. was due to the opt rule: GetEdgesTransformRule, now the issues are:

  1. fixing the bad type, with minimal reproduce:
(root@nebula) [basketballplayer]> match p=()-[e]->() return p limit 1
+----------+
| p        |
+----------+
| BAD_TYPE |
+----------+
Got 1 rows (time spent 6635034/6633859 us)

Wed, 16 Mar 2022 06:53:49 UTC

(root@nebula) [basketballplayer]> match ()-[e]->() return e limit 1
+-----------------------------------------------------------------------+
| e                                                                     |
+-----------------------------------------------------------------------+
| [:serve "player102"->"team203" @0 {end_year: 2015, start_year: 2006}] |
+-----------------------------------------------------------------------+
Got 1 rows (time spent 3404514/3404425 us)

Wed, 16 Mar 2022 06:54:06 UTC

2. fix for p=(:foo)-->() return p limit 1, which should be applied to GetEdgesTransformRule? as foo edge-src tag type cannot be pushdown.

update: after talking with @Shylock-Hg (thanks!), I came to know a. should be excluded from the opt-rule: GetEdgesTransformRule, working on it now.

@CPWstatic @Shylock-Hg

Thanks!

wey-gu added a commit to wey-gu/nebula that referenced this issue Mar 16, 2022
@wey-gu
Copy link
Contributor Author

wey-gu commented Mar 20, 2022

#4053

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: something is unexpected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants