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

param id(v) IN $var was not passthrough #4781

Closed
wey-gu opened this issue Oct 25, 2022 · 1 comment
Closed

param id(v) IN $var was not passthrough #4781

wey-gu opened this issue Oct 25, 2022 · 1 comment
Assignees
Labels
severity/minor Severity of bug type/bug/compatibility Bugs related to compatibility with other languages like openCypher. type/bug Type: something is unexpected
Milestone

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Oct 25, 2022

Describe the bug (required)

It's reported in nebula-contrib/ngbatis#64 that such a query will end up scanVertices instead of PassThrough.

(root@nebula) [basketballplayer]> :param ids => ['foo'] ;
(root@nebula) [basketballplayer]> explain match(n:team) where id(n) IN  $ids return n
Execution succeeded (time spent 953/143728 us)

Execution Plan (optimize time 313 us)

-----+----------------+--------------+----------------+--------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                               |
-----+----------------+--------------+----------------+--------------------------------------------------------------
|  7 | Project        | 6            |                | outputVar: {                                                |
|    |                |              |                |   "colNames": [                                             |
|    |                |              |                |     "n"                                                     |
|    |                |              |                |   ],                                                        |
|    |                |              |                |   "type": "DATASET",                                        |
|    |                |              |                |   "name": "__Project_7"                                     |
|    |                |              |                | }                                                           |
|    |                |              |                | inputVar: __Filter_6                                        |
|    |                |              |                | columns: [                                                  |
|    |                |              |                |   "$n"                                                      |
|    |                |              |                | ]                                                           |
-----+----------------+--------------+----------------+--------------------------------------------------------------
|  6 | Filter         | 11           |                | outputVar: {                                                |
|    |                |              |                |   "colNames": [                                             |
|    |                |              |                |     "n"                                                     |
|    |                |              |                |   ],                                                        |
|    |                |              |                |   "type": "DATASET",                                        |
|    |                |              |                |   "name": "__Filter_6"                                      |
|    |                |              |                | }                                                           |
|    |                |              |                | inputVar: __Project_5                                       |
|    |                |              |                | condition: (id($n) IN $ids)                                 |
|    |                |              |                | isStable: false                                             |
-----+----------------+--------------+----------------+--------------------------------------------------------------
| 11 | AppendVertices | 12           |                | outputVar: {                                                |
|    |                |              |                |   "colNames": [                                             |
|    |                |              |                |     "n"                                                     |
|    |                |              |                |   ],                                                        |
|    |                |              |                |   "type": "DATASET",                                        |
|    |                |              |                |   "name": "__Project_5"                                     |
|    |                |              |                | }                                                           |
|    |                |              |                | inputVar: __ScanVertices_12                                 |
|    |                |              |                | space: 67                                                   |
|    |                |              |                | dedup: true                                                 |
|    |                |              |                | limit: -1                                                   |
|    |                |              |                | filter:                                                     |
|    |                |              |                | orderBy: []                                                 |
|    |                |              |                | src: $-._vid                                                |
|    |                |              |                | props: [                                                    |
|    |                |              |                |   {                                                         |
|    |                |              |                |     "props": [                                              |
|    |                |              |                |       "name",                                               |
|    |                |              |                |       "age",                                                |
|    |                |              |                |       "_tag"                                                |
|    |                |              |                |     ],                                                      |
|    |                |              |                |     "tagId": 68                                             |
|    |                |              |                |   },                                                        |
|    |                |              |                |   {                                                         |
|    |                |              |                |     "props": [                                              |
|    |                |              |                |       "name",                                               |
|    |                |              |                |       "age",                                                |
|    |                |              |                |       "_tag"                                                |
|    |                |              |                |     ],                                                      |
|    |                |              |                |     "tagId": 74                                             |
|    |                |              |                |   },                                                        |
|    |                |              |                |   {                                                         |
|    |                |              |                |     "props": [                                              |
|    |                |              |                |       "name",                                               |
|    |                |              |                |       "_tag"                                                |
|    |                |              |                |     ],                                                      |
|    |                |              |                |     "tagId": 69                                             |
|    |                |              |                |   }                                                         |
|    |                |              |                | ]                                                           |
|    |                |              |                | exprs:                                                      |
|    |                |              |                | vertex_filter:                                              |
|    |                |              |                | if_track_previous_path: false                               |
-----+----------------+--------------+----------------+--------------------------------------------------------------
| 12 | ScanVertices   | 3            |                | outputVar: {                                                |
|    |                |              |                |   "colNames": [                                             |
|    |                |              |                |     "_vid",                                                 |
|    |                |              |                |     "team._tag"                                             |
|    |                |              |                |   ],                                                        |
|    |                |              |                |   "type": "DATASET",                                        |
|    |                |              |                |   "name": "__ScanVertices_12"                               |
|    |                |              |                | }                                                           |
|    |                |              |                | inputVar:                                                   |
|    |                |              |                | space: 67                                                   |
|    |                |              |                | dedup: false                                                |
|    |                |              |                | limit: -1                                                   |
|    |                |              |                | filter: (team._tag IS NOT EMPTY AND team._tag IS NOT EMPTY) |
|    |                |              |                | orderBy: []                                                 |
|    |                |              |                | props: [                                                    |
|    |                |              |                |   {                                                         |
|    |                |              |                |     "props": [                                              |
|    |                |              |                |       "_tag"                                                |
|    |                |              |                |     ],                                                      |
|    |                |              |                |     "tagId": 69                                             |
|    |                |              |                |   }                                                         |
|    |                |              |                | ]                                                           |
|    |                |              |                | exprs:                                                      |
-----+----------------+--------------+----------------+--------------------------------------------------------------
|  3 | Start          |              |                | outputVar: {                                                |
|    |                |              |                |   "colNames": [],                                           |
|    |                |              |                |   "type": "DATASET",                                        |
|    |                |              |                |   "name": "__Start_3"                                       |
|    |                |              |                | }                                                           |
-----+----------------+--------------+----------------+--------------------------------------------------------------

Your Environments (required)

  • OS: uname -a
  • Compiler: g++ --version or clang++ --version
  • CPU: lscpu
  • Commit id (e.g. a3ffc7d8)

How To Reproduce(required)

Steps to reproduce the behavior:

as above, or w/o explain, it reports so:

(root@nebula) [basketballplayer]> match(n:team) where id(n) IN  $ids return n
[ERROR (-1005)]: Scan vertices or edges need to specify a limit number, or limit number can not push down.

Tue, 25 Oct 2022 17:39:58 CST

Expected behavior

passthrough w/o requiring an index

Additional context

Thanks @CorvusYe to reproduce and find its minimal condition.

@wey-gu
Copy link
Contributor Author

wey-gu commented Nov 16, 2022

confirmed it's fixed with manual test, thanks @czpmango !!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/minor Severity of bug type/bug/compatibility Bugs related to compatibility with other languages like openCypher. type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

5 participants