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

Wrong error msg of matching on vertex properties #3492

Closed
randomJoe211 opened this issue Dec 17, 2021 · 12 comments · Fixed by #3549
Closed

Wrong error msg of matching on vertex properties #3492

randomJoe211 opened this issue Dec 17, 2021 · 12 comments · Fixed by #3549
Assignees
Labels
type/bug Type: something is unexpected
Milestone

Comments

@randomJoe211
Copy link
Contributor

randomJoe211 commented Dec 17, 2021

Please check the FAQ documentation before raising an issue

Been there.

Describe the bug (required)

When executing MATCH (v{name: "Tim Duncan"}) return v, it shows [ERROR (-1005)]: Scan vertices must specify limit number.

If I add LIMIT, it still tells me the same thing.
image

The error message is wrong. If matching on vertex properties is not supported, then the error message should tell me this, not a wrong reason.

Plus I have the following tag indexes:
image

Your Environments (required)

  • OS: Ubuntu 20.04
  • Commit id: nebula-graphd version 2021.12.15-nightly, Git: 99f1f7a, Build Time: Dec 16 2021 03:10:58
@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Dec 20, 2021

It's expected.
See the execution plan:

Execution Plan (optimize time 2731 us)

-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                                                |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  7 | DataCollect    | 11           |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__DataCollect_7"                                                                |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: [                                                                                  |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Limit_6"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | kind: ROW                                                                                    |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| 11 | Project        | 10           |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Limit_6"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __Project_5                                                                        |
|    |                |              |                | columns: [                                                                                   |
|    |                |              |                |   "$-.v AS v"                                                                                |
|    |                |              |                | ]                                                                                            |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| 10 | Limit          | 3            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag",                                                                         |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Project_5"                                                                    |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __AppendVertices_3                                                                 |
|    |                |              |                | offset: 0                                                                                    |
|    |                |              |                | count: 3                                                                                     |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  3 | AppendVertices | 9            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag",                                                                         |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "name": "__AppendVertices_3",                                                            |
|    |                |              |                |     "type": "DATASET"                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __Filter_2                                                                         |
|    |                |              |                | space: 2                                                                                     |
|    |                |              |                | dedup: true                                                                                  |
|    |                |              |                | limit: 0                                                                                     |
|    |                |              |                | filter:                                                                                      |
|    |                |              |                | orderBy: []                                                                                  |
|    |                |              |                | src: $-._vid                                                                                 |
|    |                |              |                | props: [                                                                                     |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 4,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 3,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "age",                                                                                 |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 5,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "speciality",                                                                          |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | exprs:                                                                                       |
|    |                |              |                | vertex filter: (*.name=="Time Duncan")                                                       |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  9 | ScanVertices   | 0            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag"                                                                          |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "name": "__Filter_2",                                                                    |
|    |                |              |                |     "type": "DATASET"                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __VAR_0                                                                            |
|    |                |              |                | space: 2                                                                                     |
|    |                |              |                | dedup: false                                                                                 |
|    |                |              |                | limit: -1                                                                                    |
|    |                |              |                | filter: ((bachelor._tag IS NOT EMPTY OR team._tag IS NOT EMPTY) OR player._tag IS NOT EMPTY) |
|    |                |              |                | orderBy: []                                                                                  |
|    |                |              |                | props: [                                                                                     |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 5,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 4,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 3,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | exprs:                                                                                       |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  0 | Start          |              |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [],                                                                          |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Start_0"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------

Mon, 20 Dec 2021 11:31:21 CST

There is a vertex filter *.name == 'Tim Duncan in AppendVertices node, it can't push down to storage. So limit can't push down too.

@Shylock-Hg
Copy link
Contributor

See the case

@randomJoe211
Copy link
Contributor Author

@Shylock-Hg Thanks for the reply. Yes, from the code's point of view, your answer may be logical. But such an answer cannot resolve the real issue, which is that the error code does not help uses to solve the problem.

Suppose you were a user, and after running a query you saw such an error code, wouldn't you modify the query according to the hint, add LIMIT and try again? And then you would find that it still reported the same error code. This is not right. @Sophie-Xie

@Sophie-Xie Sophie-Xie reopened this Dec 20, 2021
@whitewum
Copy link
Contributor

It's expected. See the execution plan:

Execution Plan (optimize time 2731 us)

-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                                                |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  7 | DataCollect    | 11           |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__DataCollect_7"                                                                |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: [                                                                                  |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Limit_6"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | kind: ROW                                                                                    |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| 11 | Project        | 10           |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Limit_6"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __Project_5                                                                        |
|    |                |              |                | columns: [                                                                                   |
|    |                |              |                |   "$-.v AS v"                                                                                |
|    |                |              |                | ]                                                                                            |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
| 10 | Limit          | 3            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag",                                                                         |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Project_5"                                                                    |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __AppendVertices_3                                                                 |
|    |                |              |                | offset: 0                                                                                    |
|    |                |              |                | count: 3                                                                                     |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  3 | AppendVertices | 9            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag",                                                                         |
|    |                |              |                |       "v"                                                                                    |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "name": "__AppendVertices_3",                                                            |
|    |                |              |                |     "type": "DATASET"                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __Filter_2                                                                         |
|    |                |              |                | space: 2                                                                                     |
|    |                |              |                | dedup: true                                                                                  |
|    |                |              |                | limit: 0                                                                                     |
|    |                |              |                | filter:                                                                                      |
|    |                |              |                | orderBy: []                                                                                  |
|    |                |              |                | src: $-._vid                                                                                 |
|    |                |              |                | props: [                                                                                     |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 4,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 3,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "age",                                                                                 |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 5,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "name",                                                                                |
|    |                |              |                |       "speciality",                                                                          |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | exprs:                                                                                       |
|    |                |              |                | vertex filter: (*.name=="Time Duncan")                                                       |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  9 | ScanVertices   | 0            |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [                                                                            |
|    |                |              |                |       "_vid",                                                                                |
|    |                |              |                |       "bachelor._tag",                                                                       |
|    |                |              |                |       "team._tag",                                                                           |
|    |                |              |                |       "player._tag"                                                                          |
|    |                |              |                |     ],                                                                                       |
|    |                |              |                |     "name": "__Filter_2",                                                                    |
|    |                |              |                |     "type": "DATASET"                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | inputVar: __VAR_0                                                                            |
|    |                |              |                | space: 2                                                                                     |
|    |                |              |                | dedup: false                                                                                 |
|    |                |              |                | limit: -1                                                                                    |
|    |                |              |                | filter: ((bachelor._tag IS NOT EMPTY OR team._tag IS NOT EMPTY) OR player._tag IS NOT EMPTY) |
|    |                |              |                | orderBy: []                                                                                  |
|    |                |              |                | props: [                                                                                     |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 5,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 4,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   },                                                                                         |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "tagId": 3,                                                                              |
|    |                |              |                |     "props": [                                                                               |
|    |                |              |                |       "_tag"                                                                                 |
|    |                |              |                |     ]                                                                                        |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
|    |                |              |                | exprs:                                                                                       |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------
|  0 | Start          |              |                | outputVar: [                                                                                 |
|    |                |              |                |   {                                                                                          |
|    |                |              |                |     "colNames": [],                                                                          |
|    |                |              |                |     "type": "DATASET",                                                                       |
|    |                |              |                |     "name": "__Start_0"                                                                      |
|    |                |              |                |   }                                                                                          |
|    |                |              |                | ]                                                                                            |
-----+----------------+--------------+----------------+-----------------------------------------------------------------------------------------------

Mon, 20 Dec 2021 11:31:21 CST

There is a vertex filter *.name == 'Tim Duncan in AppendVertices node, it can't push down to storage. So limit can't push down too.

This is what you expected ???? ARE YOU SURE ???

image

@Shylock-Hg
Copy link
Contributor

@Shylock-Hg Thanks for the reply. Yes, from the code's point of view, your answer may be logical. But such an answer cannot resolve the real issue, which is that the error code does not help uses to solve the problem.

Suppose you were a user, and after running a query you saw such an error code, wouldn't you modify the query according to the hint, add LIMIT and try again? And then you would find that it still reported the same error code. This is not right. @Sophie-Xie

The query like MATCH (v{name: "Tim Duncan"}) return v is in discussed, you could see the one proposal in #3255, how to handle the properties of vertex is not sure. So I don't process it in this PR too.

@randomJoe211
Copy link
Contributor Author

randomJoe211 commented Dec 20, 2021

It's OK if Nebula Graph does not support MATCH (v{name: "Tim Duncan"}) return v.

The problem here is, running MATCH (v{name: "Tim Duncan"}) return v returns Scan edges must specify limit number, and if users follow this information and run MATCH (v{name: "Tim Duncan"}) return v LIMIT 10, it still shows Scan edges must specify limit number. It doesn't make any sense.

Again, it is OK if Nebula Graph does not support such a feature, but it cannot mislead users with such a wrong return. This is the real concern.

BTW, it is not related to any specific PR. I'm not saying that a certain PR created such an issue. I just hope that this issue can be resolved. For example:

Running MATCH (v{name: "Tim Duncan"}) return v returns xxx is not supported.
Or, Nebula Graph supports MATCH (v{name: "Tim Duncan"}) return v.
Or any other logical solution.

@Shylock-Hg
Copy link
Contributor

In this case, we have two error:

  1. match (v) return v , which don't specify limit
  2. match (v{'name': 'Time Duncan'}) return v limit 3, which can't push down this limit

But in implementation, these two cases will be checked in same process. We could change error message to more friendly to user, but can't provide two error message.
WDYT?

@randomJoe211
Copy link
Contributor Author

What message do you plan to code?

@Shylock-Hg
Copy link
Contributor

If want to provide two error message

What message do you plan to code?

Do you have suggestion?

@randomJoe211
Copy link
Contributor Author

If we can have two different messages for the two situations, then they may be To scan vertices, specify a LIMIT number. and Scanning by properties are not supported.

But if you wish to explain the two situations in one message, maybe To scan vertices, specify a LIMIT number. Scanning vertices by properties are not supported.? It's not a good error message. Do not use it unless you have no other solution. If you have to, I hope it is just a workaround, not the final solution.

@Shylock-Hg
Copy link
Contributor

If we can have two different messages for the two situations, then they may be To scan vertices, specify a LIMIT number. and Scanning by properties are not supported.

But if you wish to explain the two situations in one message, maybe To scan vertices, specify a LIMIT number. Scanning vertices by properties are not supported.? It's not a good error message. Do not use it unless you have no other solution. If you have to, I hope it is just a workaround, not the final solution.

This error is not just for scan vertices and with properties, how about To scan vertices or edges need specify a LIMIT number, and LIMIT number need push down to scan.?

@randomJoe211
Copy link
Contributor Author

You decide.

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.

5 participants