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

VID provided in parameter will be treated as prop/index scan #3982

Closed
wey-gu opened this issue Mar 4, 2022 · 1 comment
Closed

VID provided in parameter will be treated as prop/index scan #3982

wey-gu opened this issue Mar 4, 2022 · 1 comment
Assignees
Labels
type/bug Type: something is unexpected type/enhancement Type: make the code neat or more efficient
Milestone

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Mar 4, 2022

Please check the FAQ documentation before raising an issue

Describe the bug (required)

It seems parameter in id(n) == $var will end up raising errors on datascan rather than from vid.

Your Environments (required)

How To Reproduce(required)

Steps to reproduce the behavior:

(root@nebula) [amundsen]> :param t => "dynamo://gold.test_schema"
(root@nebula) [amundsen]> MATCH (n) WHERE id(n) == $t RETURN n
[ERROR (-1005)]: Scan vertices or edges need to specify a limit number, or limit number can not push down.

Fri, 04 Mar 2022 20:02:27 CST

Expected behavior

Additional context

(root@nebula) [basketballplayer]> explain MATCH (n) WHERE id(n) == $t RETURN n
Execution succeeded (time spent 482/25704 us)

Execution Plan (optimize time 93 us)

-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                                                                     |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
| 10 | Project        | 9            |                | outputVar: [                                                                                                      |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "colNames": [                                                                                                 |
|    |                |              |                |       "n"                                                                                                         |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "type": "DATASET",                                                                                            |
|    |                |              |                |     "name": "__Project_7"                                                                                         |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | inputVar: __Filter_9                                                                                              |
|    |                |              |                | columns: [                                                                                                        |
|    |                |              |                |   "$-.n AS n"                                                                                                     |
|    |                |              |                | ]                                                                                                                 |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
|  9 | Filter         | 4            |                | outputVar: [                                                                                                      |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "colNames": [                                                                                                 |
|    |                |              |                |       "n"                                                                                                         |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "type": "DATASET",                                                                                            |
|    |                |              |                |     "name": "__Filter_9"                                                                                          |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | inputVar: __AppendVertices_4                                                                                      |
|    |                |              |                | condition: (id($-.n)==$t)                                                                                         |
|    |                |              |                | isStable: false                                                                                                   |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
|  4 | AppendVertices | 11           |                | outputVar: [                                                                                                      |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "colNames": [                                                                                                 |
|    |                |              |                |       "n"                                                                                                         |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "type": "DATASET",                                                                                            |
|    |                |              |                |     "name": "__AppendVertices_4"                                                                                  |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | inputVar: __Filter_2                                                                                              |
|    |                |              |                | space: 1                                                                                                          |
|    |                |              |                | dedup: true                                                                                                       |
|    |                |              |                | limit: 0                                                                                                          |
|    |                |              |                | filter:                                                                                                           |
|    |                |              |                | orderBy: []                                                                                                       |
|    |                |              |                | src: $-._vid                                                                                                      |
|    |                |              |                | props: [                                                                                                          |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "name",                                                                                                     |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 3                                                                                                    |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "name",                                                                                                     |
|    |                |              |                |       "age",                                                                                                      |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 2                                                                                                    |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 9                                                                                                    |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 10                                                                                                   |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | exprs:                                                                                                            |
|    |                |              |                | if_track_previous_path: false                                                                                     |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
| 11 | ScanVertices   | 3            |                | outputVar: [                                                                                                      |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "colNames": [                                                                                                 |
|    |                |              |                |       "_vid",                                                                                                     |
|    |                |              |                |       "space._tag",                                                                                               |
|    |                |              |                |       "user._tag",                                                                                                |
|    |                |              |                |       "team._tag",                                                                                                |
|    |                |              |                |       "player._tag"                                                                                               |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "type": "DATASET",                                                                                            |
|    |                |              |                |     "name": "__Filter_2"                                                                                          |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | inputVar:                                                                                                         |
|    |                |              |                | space: 1                                                                                                          |
|    |                |              |                | dedup: false                                                                                                      |
|    |                |              |                | limit: -1                                                                                                         |
|    |                |              |                | filter: (space._tag IS NOT EMPTY OR user._tag IS NOT EMPTY OR team._tag IS NOT EMPTY OR player._tag IS NOT EMPTY) |
|    |                |              |                | orderBy: []                                                                                                       |
|    |                |              |                | props: [                                                                                                          |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 10                                                                                                   |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 9                                                                                                    |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 3                                                                                                    |
|    |                |              |                |   },                                                                                                              |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "props": [                                                                                                    |
|    |                |              |                |       "_tag"                                                                                                      |
|    |                |              |                |     ],                                                                                                            |
|    |                |              |                |     "tagId": 2                                                                                                    |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
|    |                |              |                | exprs:                                                                                                            |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------
|  3 | Start          |              |                | outputVar: [                                                                                                      |
|    |                |              |                |   {                                                                                                               |
|    |                |              |                |     "colNames": [],                                                                                               |
|    |                |              |                |     "type": "DATASET",                                                                                            |
|    |                |              |                |     "name": "__Start_3"                                                                                           |
|    |                |              |                |   }                                                                                                               |
|    |                |              |                | ]                                                                                                                 |
-----+----------------+--------------+----------------+--------------------------------------------------------------------------------------------------------------------

Fri, 04 Mar 2022 20:34:18 CST

(root@nebula) [basketballplayer]> explain MATCH (n) WHERE id(n) == "a" RETURN n
Execution succeeded (time spent 423/25284 us)

Execution Plan (optimize time 82 us)

-----+----------------+--------------+----------------+-----------------------------------
| id | name           | dependencies | profiling data | operator info                    |
-----+----------------+--------------+----------------+-----------------------------------
| 10 | Project        | 9            |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [                |
|    |                |              |                |       "n"                        |
|    |                |              |                |     ],                           |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__Project_7"        |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | inputVar: __Filter_9             |
|    |                |              |                | columns: [                       |
|    |                |              |                |   "$-.n AS n"                    |
|    |                |              |                | ]                                |
-----+----------------+--------------+----------------+-----------------------------------
|  9 | Filter         | 4            |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [                |
|    |                |              |                |       "n"                        |
|    |                |              |                |     ],                           |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__Filter_9"         |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | inputVar: __AppendVertices_4     |
|    |                |              |                | condition: (id($-.n)=="a")       |
|    |                |              |                | isStable: false                  |
-----+----------------+--------------+----------------+-----------------------------------
|  4 | AppendVertices | 2            |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [                |
|    |                |              |                |       "n"                        |
|    |                |              |                |     ],                           |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__AppendVertices_4" |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | inputVar: __Dedup_2              |
|    |                |              |                | space: 1                         |
|    |                |              |                | dedup: true                      |
|    |                |              |                | limit: 0                         |
|    |                |              |                | filter:                          |
|    |                |              |                | orderBy: []                      |
|    |                |              |                | src: $-._vid                     |
|    |                |              |                | props: [                         |
|    |                |              |                |   {                              |
|    |                |              |                |     "props": [                   |
|    |                |              |                |       "name",                    |
|    |                |              |                |       "_tag"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "tagId": 3                   |
|    |                |              |                |   },                             |
|    |                |              |                |   {                              |
|    |                |              |                |     "props": [                   |
|    |                |              |                |       "name",                    |
|    |                |              |                |       "age",                     |
|    |                |              |                |       "_tag"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "tagId": 2                   |
|    |                |              |                |   },                             |
|    |                |              |                |   {                              |
|    |                |              |                |     "props": [                   |
|    |                |              |                |       "_tag"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "tagId": 9                   |
|    |                |              |                |   },                             |
|    |                |              |                |   {                              |
|    |                |              |                |     "props": [                   |
|    |                |              |                |       "_tag"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "tagId": 10                  |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | exprs:                           |
|    |                |              |                | if_track_previous_path: false    |
-----+----------------+--------------+----------------+-----------------------------------
|  2 | Dedup          | 1            |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [                |
|    |                |              |                |       "_vid"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__Dedup_2"          |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | inputVar: __VAR_0                |
-----+----------------+--------------+----------------+-----------------------------------
|  1 | PassThrough    | 3            |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [                |
|    |                |              |                |       "_vid"                     |
|    |                |              |                |     ],                           |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__VAR_0"            |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
|    |                |              |                | inputVar:                        |
-----+----------------+--------------+----------------+-----------------------------------
|  3 | Start          |              |                | outputVar: [                     |
|    |                |              |                |   {                              |
|    |                |              |                |     "colNames": [],              |
|    |                |              |                |     "type": "DATASET",           |
|    |                |              |                |     "name": "__Start_3"          |
|    |                |              |                |   }                              |
|    |                |              |                | ]                                |
-----+----------------+--------------+----------------+-----------------------------------
@wey-gu wey-gu added type/bug Type: something is unexpected type/enhancement Type: make the code neat or more efficient and removed type/bug Type: something is unexpected labels Mar 4, 2022
@Shylock-Hg Shylock-Hg added the type/bug Type: something is unexpected label Mar 7, 2022
@Sophie-Xie Sophie-Xie added this to the v3.1.0 milestone Mar 7, 2022
@wey-gu wey-gu mentioned this issue Mar 14, 2022
11 tasks
@wey-gu
Copy link
Contributor Author

wey-gu commented Apr 1, 2022

close with #4024

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 type/enhancement Type: make the code neat or more efficient
Projects
None yet
Development

No branches or pull requests

4 participants