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

Enhancement remove useless project. #4157

Merged

Conversation

Shylock-Hg
Copy link
Contributor

@Shylock-Hg Shylock-Hg commented Apr 14, 2022

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

Close #4171

Description:

Require #4156
Avoid modify not matched plan nodes.

How do you solve it?

Special notes for your reviewer, ex. impact of this fix, design document, etc:

Checklist:

Tests:

  • Unit test(positive and negative cases)
  • Function test
  • Performance test
  • N/A

Affects:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatibility (If it breaks the compatibility, please describe it and add the label.)
  • If it's needed to cherry-pick (If cherry-pick to some branches is required, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to be reflected in release notes and how to describe:

ex. Fixed the bug .....

@Shylock-Hg Shylock-Hg added this to the v3.2.0 milestone Apr 18, 2022
@Shylock-Hg Shylock-Hg added the ready-for-testing PR: ready for the CI test label Apr 28, 2022
@Shylock-Hg
Copy link
Contributor Author

The original implementation won't check input/output dataflow between Project and its dependencies, so will lead broken promise in runtime.
e.g.

explain  match (m:player) where id(m) == 'Tim Duncan' match (m)<--(e) return {name:m.player.name, start:collect({name:e.player.age})}

Origin plan:

-----+----------------+--------------+----------------+----------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 14 | Project        | 13           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "{name:m.player.name,start:collect({name:e.player.age})}" |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Project_14",                                     |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Aggregate_13                                      |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "{name:$m.player.name,start:$collect({name:e.player.age})}" |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 13 | Aggregate      | 12           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m.player.name",                                          |
|    |                |              |                |     "collect({name:e.player.age})"                            |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Aggregate_13"                                    |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __BiInnerJoin_12                                    |
|    |                |              |                | groupKeys: [                                                  |
|    |                |              |                |   "m.player.name"                                             |
|    |                |              |                | ]                                                             |
|    |                |              |                | groupItems: [                                                 |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "expr": "m.player.name"                                   |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "expr": "collect({name:e.player.age})"                    |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 12 | BiInnerJoin    | 6,11         |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__BiInnerJoin_12"                                  |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: {                                                   |
|    |                |              |                |   "rightVar": "__Project_11",                                 |
|    |                |              |                |   "leftVar": "__Filter_6"                                     |
|    |                |              |                | }                                                             |
|    |                |              |                | hashKeys: [                                                   |
|    |                |              |                |   "id($-.m)"                                                  |
|    |                |              |                | ]                                                             |
|    |                |              |                | probeKeys: [                                                  |
|    |                |              |                |   "id($-.m)"                                                  |
|    |                |              |                | ]                                                             |
|    |                |              |                | kind: InnerJoin                                               |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  6 | Filter         | 5            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Filter_6",                                       |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Project_5                                         |
|    |                |              |                | condition: (id($m)=="Tim Duncan")                             |
|    |                |              |                | isStable: false                                               |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  5 | Project        | 4            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Project_5"                                       |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_4                                  |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "$-.m AS m"                                                 |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  4 | AppendVertices | 2            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__AppendVertices_4"                                |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Dedup_2                                           |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: $-._vid                                                  |
|    |                |              |                | props: [                                                      |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "name",                                                 |
|    |                |              |                |       "_tag"                                                  |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "tagId": 9                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | vertex_filter: player._tag IS NOT EMPTY                       |
|    |                |              |                | if_track_previous_path: false                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  2 | Dedup          | 1            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "_vid"                                                    |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Dedup_2",                                        |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __VAR_1                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  1 | PassThrough    | 3            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "_vid"                                                    |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__VAR_1"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar:                                                     |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  3 | Start          |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [],                                             |
|    |                |              |                |   "name": "__Start_3",                                        |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 11 | Project        | 10           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Project_11"                                      |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_10                                 |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "$-.m AS m",                                                |
|    |                |              |                |   "$-.e AS e"                                                 |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 10 | AppendVertices | 9            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "__VAR_0",                                                |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__AppendVertices_10",                              |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Traverse_9                                        |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: none_direct_dst($-.__VAR_0)                              |
|    |                |              |                | props: [                                                      |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "age"                                                   |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "tagId": 9                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | vertex_filter:                                                |
|    |                |              |                | if_track_previous_path: true                                  |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  9 | Traverse       | 7            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "__VAR_0"                                                 |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Traverse_9"                                      |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Argument_7                                        |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: id($-.m)                                                 |
|    |                |              |                | edgeTypes: []                                                 |
|    |                |              |                | edgeDirection: IN_EDGE                                        |
|    |                |              |                | vertexProps: [                                                |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "tagId": 9,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "name",                                                 |
|    |                |              |                |       "_tag"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | edgeProps: [                                                  |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "type": -5,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "type": -3,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "type": -4                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | statProps:                                                    |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | random: false                                                 |
|    |                |              |                | steps:                                                        |
|    |                |              |                | vertex filter:                                                |
|    |                |              |                | edge filter:                                                  |
|    |                |              |                | if_track_previous_path: false                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  7 | Argument       |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Argument_7",                                     |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_4                                  |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  8 | Start          |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [],                                             |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Start_8"                                         |
|    |                |              |                | }                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------

After eliminating the Project:

-----+----------------+--------------+----------------+----------------------------------------------------------------
| id | name           | dependencies | profiling data | operator info                                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 14 | Project        | 13           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "{name:m.player.name,start:collect({name:e.player.age})}" |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Project_14",                                     |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Aggregate_13                                      |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "{name:$m.player.name,start:$collect({name:e.player.age})}" |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 13 | Aggregate      | 12           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m.player.name",                                          |
|    |                |              |                |     "collect({name:e.player.age})"                            |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Aggregate_13"                                    |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __BiInnerJoin_12                                    |
|    |                |              |                | groupKeys: [                                                  |
|    |                |              |                |   "m.player.name"                                             |
|    |                |              |                | ]                                                             |
|    |                |              |                | groupItems: [                                                 |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "expr": "m.player.name"                                   |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "expr": "collect({name:e.player.age})"                    |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 12 | BiInnerJoin    | 6,11         |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__BiInnerJoin_12"                                  |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: {                                                   |
|    |                |              |                |   "rightVar": "__Project_11",                                 |
|    |                |              |                |   "leftVar": "__Filter_6"                                     |
|    |                |              |                | }                                                             |
|    |                |              |                | hashKeys: [                                                   |
|    |                |              |                |   "id($-.m)"                                                  |
|    |                |              |                | ]                                                             |
|    |                |              |                | probeKeys: [                                                  |
|    |                |              |                |   "id($-.m)"                                                  |
|    |                |              |                | ]                                                             |
|    |                |              |                | kind: InnerJoin                                               |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  6 | Filter         | 5            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Filter_6",                                       |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Project_5                                         |
|    |                |              |                | condition: (id($m)=="Tim Duncan")                             |
|    |                |              |                | isStable: false                                               |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  5 | Project        | 4            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Project_5"                                       |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_4                                  |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "$-.m AS m"                                                 |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  4 | AppendVertices | 2            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__AppendVertices_4"                                |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Dedup_2                                           |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: $-._vid                                                  |
|    |                |              |                | props: [                                                      |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "name",                                                 |
|    |                |              |                |       "_tag"                                                  |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "tagId": 9                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | vertex_filter: player._tag IS NOT EMPTY                       |
|    |                |              |                | if_track_previous_path: false                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  2 | Dedup          | 1            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "_vid"                                                    |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Dedup_2",                                        |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __VAR_1                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  1 | PassThrough    | 3            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "_vid"                                                    |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__VAR_1"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar:                                                     |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  3 | Start          |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [],                                             |
|    |                |              |                |   "name": "__Start_3",                                        |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 11 | Project        | 10           |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Project_11"                                      |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_10                                 |
|    |                |              |                | columns: [                                                    |
|    |                |              |                |   "$-.m AS m",                                                |
|    |                |              |                |   "$-.e AS e"                                                 |
|    |                |              |                | ]                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------
| 10 | AppendVertices | 9            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "__VAR_0",                                                |
|    |                |              |                |     "e"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__AppendVertices_10",                              |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Traverse_9                                        |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: none_direct_dst($-.__VAR_0)                              |
|    |                |              |                | props: [                                                      |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "age"                                                   |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "tagId": 9                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | vertex_filter:                                                |
|    |                |              |                | if_track_previous_path: true                                  |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  9 | Traverse       | 7            |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m",                                                      |
|    |                |              |                |     "__VAR_0"                                                 |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Traverse_9"                                      |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __Argument_7                                        |
|    |                |              |                | space: 2                                                      |
|    |                |              |                | dedup: true                                                   |
|    |                |              |                | limit: -1                                                     |
|    |                |              |                | filter:                                                       |
|    |                |              |                | orderBy: []                                                   |
|    |                |              |                | src: id($-.m)                                                 |
|    |                |              |                | edgeTypes: []                                                 |
|    |                |              |                | edgeDirection: IN_EDGE                                        |
|    |                |              |                | vertexProps: [                                                |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "tagId": 9,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "name",                                                 |
|    |                |              |                |       "_tag"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | edgeProps: [                                                  |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "type": -5,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "type": -3,                                               |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ]                                                         |
|    |                |              |                |   },                                                          |
|    |                |              |                |   {                                                           |
|    |                |              |                |     "props": [                                                |
|    |                |              |                |       "_dst",                                                 |
|    |                |              |                |       "_rank",                                                |
|    |                |              |                |       "_type",                                                |
|    |                |              |                |       "_src"                                                  |
|    |                |              |                |     ],                                                        |
|    |                |              |                |     "type": -4                                                |
|    |                |              |                |   }                                                           |
|    |                |              |                | ]                                                             |
|    |                |              |                | statProps:                                                    |
|    |                |              |                | exprs:                                                        |
|    |                |              |                | random: false                                                 |
|    |                |              |                | steps:                                                        |
|    |                |              |                | vertex filter:                                                |
|    |                |              |                | edge filter:                                                  |
|    |                |              |                | if_track_previous_path: false                                 |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  7 | Argument       |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [                                               |
|    |                |              |                |     "m"                                                       |
|    |                |              |                |   ],                                                          |
|    |                |              |                |   "name": "__Argument_7",                                     |
|    |                |              |                |   "type": "DATASET"                                           |
|    |                |              |                | }                                                             |
|    |                |              |                | inputVar: __AppendVertices_4                                  |
-----+----------------+--------------+----------------+----------------------------------------------------------------
|  8 | Start          |              |                | outputVar: {                                                  |
|    |                |              |                |   "colNames": [],                                             |
|    |                |              |                |   "type": "DATASET",                                          |
|    |                |              |                |   "name": "__Start_8"                                         |
|    |                |              |                | }                                                             |
-----+----------------+--------------+----------------+----------------------------------------------------------------

Now Argument_7 will reference the non-existent output variable AppendVertices_4 which is reproduce to new variable in RemoveNoopProjectRule.
@yixinglu

@Shylock-Hg Shylock-Hg requested a review from yixinglu May 5, 2022 11:07
@Sophie-Xie Sophie-Xie removed the request for review from yixinglu June 6, 2022 02:31
@codecov-commenter
Copy link

Codecov Report

Merging #4157 (f6abdf4) into master (fba3b18) will increase coverage by 0.02%.
The diff coverage is 83.79%.

@@            Coverage Diff             @@
##           master    #4157      +/-   ##
==========================================
+ Coverage   84.92%   84.95%   +0.02%     
==========================================
  Files        1328     1341      +13     
  Lines      131930   133297    +1367     
==========================================
+ Hits       112045   113241    +1196     
- Misses      19885    20056     +171     
Impacted Files Coverage Δ
src/graph/context/Iterator.cpp 87.68% <0.00%> (+0.27%) ⬆️
src/graph/context/Iterator.h 70.76% <ø> (ø)
src/graph/context/ast/CypherAstContext.h 100.00% <ø> (ø)
...rc/graph/executor/algo/ProduceAllPathsExecutor.cpp 97.67% <ø> (ø)
src/graph/optimizer/OptGroup.h 100.00% <ø> (ø)
src/graph/optimizer/OptRule.h 100.00% <ø> (ø)
src/graph/planner/match/MatchClausePlanner.h 100.00% <ø> (ø)
src/graph/planner/match/MatchPathPlanner.h 100.00% <ø> (ø)
src/graph/planner/plan/PlanNode.h 90.09% <0.00%> (+2.70%) ⬆️
src/storage/query/QueryBaseProcessor.h 100.00% <ø> (ø)
... and 133 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 117e01a...f6abdf4. Read the comment docs.

@Sophie-Xie Sophie-Xie requested review from czpmango and jievince June 13, 2022 03:26
Copy link
Contributor

@czpmango czpmango left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@Sophie-Xie Sophie-Xie merged commit d8a9c14 into vesoft-inc:master Jun 14, 2022
@Shylock-Hg Shylock-Hg deleted the enhancement/remove-uselesss-project branch June 14, 2022 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready for review ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove the useless Project in plan
6 participants