Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

match doesn't return result #2636

Open
Nicole00 opened this issue Jul 8, 2021 · 10 comments
Open

match doesn't return result #2636

Nicole00 opened this issue Jul 8, 2021 · 10 comments
Labels
duplicate Solution: this issue or pull request already exists type/feature req Type: feature request

Comments

@Nicole00
Copy link
Contributor

Nicole00 commented Jul 8, 2021

image
when vertex's multi tags have the same property col1, then match(v:person{col1:"12"}) return v does not return data.

@HarrisChu
Copy link
Contributor

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Jul 8, 2021

Has index data in it?

@Nicole00
Copy link
Contributor Author

Nicole00 commented Jul 8, 2021

Has index data in it?

Yes, if no index built on the property, it will print the error message.
image

@HarrisChu
Copy link
Contributor

add profile

  1. scan in index, and then find 1 row.
  2. filter with condition VERTEX.col1=="12"
  3. as there are two tag with some property col1, it may compare "12" with odps tag property, and dedup.
(root@nebula) [test]> profile match (v:person{col1:"12"}) return v
Empty set (time spent 16969/56738 us)

Execution Plan (optimize time 445 us)

-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
| id | name        | dependencies | profiling data                                       | operator info                                   |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  9 | Project     | 8            | ver: 0, rows: 0, execTime: 439us, totalTime: 440us   | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [                               |
|    |             |              |                                                      |       "v"                                       |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Project_9"                       |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __Filter_8                            |
|    |             |              |                                                      | columns: [                                      |
|    |             |              |                                                      |   "$v"                                          |
|    |             |              |                                                      | ]                                               |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  8 | Filter      | 7            | ver: 0, rows: 0, execTime: 1us, totalTime: 2us       | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [                               |
|    |             |              |                                                      |       "v",                                      |
|    |             |              |                                                      |       "__COL_0"                                 |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Filter_8"                        |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __Project_7                           |
|    |             |              |                                                      | condition: !(hasSameEdgeInPath($-.__COL_0))     |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  7 | Project     | 6            | ver: 0, rows: 0, execTime: 4us, totalTime: 5us       | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [                               |
|    |             |              |                                                      |       "v",                                      |
|    |             |              |                                                      |       "__COL_0"                                 |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Project_7"                       |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __Project_6                           |
|    |             |              |                                                      | columns: [                                      |
|    |             |              |                                                      |   "startNode($-._path) AS v",                   |
|    |             |              |                                                      |   "reversePath(PathBuild[$-._path]) AS __COL_0" |
|    |             |              |                                                      | ]                                               |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  6 | Project     | 5            | ver: 0, rows: 0, execTime: 2684us, totalTime: 2687us | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [                               |
|    |             |              |                                                      |       "_path"                                   |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Project_6"                       |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __Filter_5                            |
|    |             |              |                                                      | columns: [                                      |
|    |             |              |                                                      |   "PathBuild[VERTEX]"                           |
|    |             |              |                                                      | ]                                               |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  5 | Filter      | 13           | ver: 0, rows: 0, execTime: 57us, totalTime: 58us     | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [],                             |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Filter_5"                        |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __GetVertices_4                       |
|    |             |              |                                                      | condition: (VERTEX.col1=="12")                  |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
| 13 | GetVertices | 10           | {                                                    | outputVar: [                                    |
|    |             |              | ver: 0, rows: 1, execTime: 28us, totalTime: 1903us   |   {                                             |
|    |             |              | "storaged0":9779 exec/total: 328(us)/672(us)         |     "colNames": [],                             |
|    |             |              | total_rpc: 1837(us)                                  |     "type": "DATASET",                          |
|    |             |              | }                                                    |     "name": "__GetVertices_4"                   |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar: __IndexScan_1                         |
|    |             |              |                                                      | space: 6                                        |
|    |             |              |                                                      | dedup: true                                     |
|    |             |              |                                                      | limit: 9223372036854775807                      |
|    |             |              |                                                      | filter:                                         |
|    |             |              |                                                      | orderBy: []                                     |
|    |             |              |                                                      | src: $_vid                                      |
|    |             |              |                                                      | props: [                                        |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "props": [                                  |
|    |             |              |                                                      |       "col1",                                   |
|    |             |              |                                                      |       "col2",                                   |
|    |             |              |                                                      |       "col3",                                   |
|    |             |              |                                                      |       "col4",                                   |
|    |             |              |                                                      |       "col5",                                   |
|    |             |              |                                                      |       "col6",                                   |
|    |             |              |                                                      |       "col7",                                   |
|    |             |              |                                                      |       "col8",                                   |
|    |             |              |                                                      |       "col9",                                   |
|    |             |              |                                                      |       "col10",                                  |
|    |             |              |                                                      |       "col11",                                  |
|    |             |              |                                                      |       "col12",                                  |
|    |             |              |                                                      |       "col13",                                  |
|    |             |              |                                                      |       "name",                                   |
|    |             |              |                                                      |       "age",                                    |
|    |             |              |                                                      |       "born",                                   |
|    |             |              |                                                      |       "_tag"                                    |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "tagId": 7                                  |
|    |             |              |                                                      |   },                                            |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "props": [                                  |
|    |             |              |                                                      |       "col1",                                   |
|    |             |              |                                                      |       "col2",                                   |
|    |             |              |                                                      |       "col3",                                   |
|    |             |              |                                                      |       "col4",                                   |
|    |             |              |                                                      |       "col5",                                   |
|    |             |              |                                                      |       "col6",                                   |
|    |             |              |                                                      |       "col7",                                   |
|    |             |              |                                                      |       "_tag"                                    |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "tagId": 24                                 |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | exprs:                                          |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
| 10 | IndexScan   | 0            | ver: 0, rows: 1, execTime: 0us, totalTime: 4525us    | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [                               |
|    |             |              |                                                      |       "_vid"                                    |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__IndexScan_1"                     |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | inputVar:                                       |
|    |             |              |                                                      | space: 6                                        |
|    |             |              |                                                      | dedup: false                                    |
|    |             |              |                                                      | limit: 9223372036854775807                      |
|    |             |              |                                                      | filter:                                         |
|    |             |              |                                                      | orderBy: []                                     |
|    |             |              |                                                      | schemaId: 7                                     |
|    |             |              |                                                      | isEdge: false                                   |
|    |             |              |                                                      | returnCols: [                                   |
|    |             |              |                                                      |   "_vid"                                        |
|    |             |              |                                                      | ]                                               |
|    |             |              |                                                      | indexCtx: [                                     |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "columnHints": [                            |
|    |             |              |                                                      |       {                                         |
|    |             |              |                                                      |         "endValue": "__EMPTY__",                |
|    |             |              |                                                      |         "beginValue": "\"12",                   |
|    |             |              |                                                      |         "scanType": "PREFIX",                   |
|    |             |              |                                                      |         "column": "col1"                        |
|    |             |              |                                                      |       }                                         |
|    |             |              |                                                      |     ],                                          |
|    |             |              |                                                      |     "filter": "",                               |
|    |             |              |                                                      |     "index_id": 16                              |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------
|  0 | Start       |              | ver: 0, rows: 0, execTime: 0us, totalTime: 39us      | outputVar: [                                    |
|    |             |              |                                                      |   {                                             |
|    |             |              |                                                      |     "colNames": [],                             |
|    |             |              |                                                      |     "type": "DATASET",                          |
|    |             |              |                                                      |     "name": "__Start_0"                         |
|    |             |              |                                                      |   }                                             |
|    |             |              |                                                      | ]                                               |
-----+-------------+--------------+------------------------------------------------------+--------------------------------------------------

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Jul 8, 2021

Has index data in it?

Yes, if no index built on the property, it will print the error message.
image

There are two concepts. Has the index and has the index data. The tag has index but maybe has no index data in storage. For example, insert vertex first then create index.

@Nicole00
Copy link
Contributor Author

Nicole00 commented Jul 9, 2021

Has index data in it?

Yes, if no index built on the property, it will print the error message.
image

There are two concepts. Has the index and has the index data. The tag has index but maybe has no index data in storage. For example, insert vertex first then create index.

The problem is : LOOKUP can return the right result, but MATCH return nothing.
image

@Shylock-Hg
Copy link
Contributor

Shylock-Hg commented Jul 9, 2021

It's a known issue, for the same name property the behavior of match query is undefined, that we select the property value by chance.

@Shylock-Hg
Copy link
Contributor

@randomJoe211 Do we notice this to user in document?

@whitewum
Copy link
Contributor

whitewum commented Jul 9, 2021

@randomJoe211 Do we notice this to user in document?

Dozens of times.

@CPWstatic CPWstatic transferred this issue from vesoft-inc/nebula-graph Aug 27, 2021
@CPWstatic CPWstatic added duplicate Solution: this issue or pull request already exists type/feature req Type: feature request labels Aug 28, 2021
@critical27
Copy link
Contributor

critical27 commented Aug 31, 2021

Which one issue do we need to use? Do we need to fix? @Sophie-Xie @CPWstatic, just track them in one issue.

yixinglu added a commit to yixinglu/nebula that referenced this issue Sep 14, 2023
Co-authored-by: Yee <2520865+yixinglu@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Solution: this issue or pull request already exists type/feature req Type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants