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

Support the tck format for the output of EXPLAIN #5414

Merged
merged 4 commits into from
Mar 30, 2023
Merged

Support the tck format for the output of EXPLAIN #5414

merged 4 commits into from
Mar 30, 2023

Conversation

AntiTopQuark
Copy link
Contributor

@AntiTopQuark AntiTopQuark commented Mar 19, 2023

What type of PR is this?

  • bug
  • feature
  • enhancement

What problem(s) does this PR solve?

Issue(s) number:

#5274

Description:

Support the tck format for the output of EXPLAIN

How do you solve it?

Explain/Profile has added support for the TCK output format, with the "TCK" string being appended to the kAllowedFmtType list.

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

related link:

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 .....

@CLAassistant
Copy link

CLAassistant commented Mar 19, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi. Thanks for the contribution. I think an example of using the new format could be added to show how the results look like.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(root@nebula) [my_space_1]> explain format="tck" FETCH PROP ON player "player_1","player_2","player_3" yield properties(vertex).name as name, properties(vertex).age as age;
Execution succeeded (time spent 261µs/613.718µs)

Execution Plan (optimize time 28 us)

                                                          
| id | name        | dependencies | profiling data | operator info |
|  2 | Project     | 1            |                |               |
|  1 | GetVertices | 0            |                |               |
|  0 | Start       |              |                |               |
                                                          

Wed, 22 Mar 2023 23:15:52 CST

(root@nebula) [my_space_1]> explain format="tck" show hosts;
Execution succeeded (time spent 158µs/496.504µs)

Execution Plan (optimize time 23 us)

                                                        
| id | name      | dependencies | profiling data | operator info |
|  1 | ShowHosts | 0            |                |               |
|  0 | Start     |              |                |               |
                                                        

Wed, 22 Mar 2023 23:16:02 CST

(root@nebula) [my_space_1]> profile format="tck" FETCH PROP ON player "player_1","player_2","player_3" yield properties(vertex).name as name, properties(vertex).age as age;
                  
| name         | age |
| "Piter Park" | 24  |
| "aaa"        | 24  |
| "ccc"        | 24  |
                  
Got 3 rows (time spent 1.474ms/2.19677ms)

Execution Plan (optimize time 41 us)

                                                                                                                                                               
| id | name        | dependencies | profiling data                                                                                                      | operator info |
|  2 | Project     | 1            | {"rows":3,"version":0}                                                                                              |               |
|  1 | GetVertices | 0            | {"resp[0]":{"exec":"232(us)","host":"127.0.0.1:9779","total":"758(us)"},"rows":3,"total_rpc":"875(us)","version":0} |               |
|  0 | Start       |              | {"rows":0,"version":0}                                                                                              |               |
                                                                                                                                                               

Wed, 22 Mar 2023 23:16:13 CST

(root@nebula) [my_space_1]> profile format="tck" show hosts;
                                                                                           
| Host        | Port | Status   | Leader count | Leader distribution | Partition distribution | Version |
| "127.0.0.1" | 9779 | "ONLINE" | 100          | "my_space_1:100"    | "my_space_1:100"       | ""      |
                                                                                           
Got 1 rows (time spent 1.156ms/1.627659ms)

Execution Plan (optimize time 55 us)

                                                                
| id | name      | dependencies | profiling data         | operator info |
|  1 | ShowHosts | 0            | {"rows":1,"version":0} |               |
|  0 | Start     |              | {"rows":0,"version":0} |               |
                                                                

Wed, 22 Mar 2023 23:16:28 CST

(root@nebula) [my_space_1]> 
(root@nebula) [my_space_1]> profile format="row" FETCH PROP ON player "player_1","player_2","player_3" yield properties(vertex).name as name, properties(vertex).age as age;
+--------------+-----+
| name         | age |
+--------------+-----+
| "Piter Park" | 24  |
| "aaa"        | 24  |
| "ccc"        | 24  |
+--------------+-----+
Got 3 rows (time spent 1.716ms/2.344165ms)

Execution Plan (optimize time 29 us)


-----+-------------+--------------+-------------------------------+---------------------------------------
| id | name        | dependencies | profiling data                | operator info                        |
-----+-------------+--------------+-------------------------------+---------------------------------------
|  2 | Project     | 1            | {                             | outputVar: {                         |
|    |             |              |   "execTime": "27(us)",       |   "colNames": [                      |
|    |             |              |   "rows": 3,                  |     "name",                          |
|    |             |              |   "totalTime": "30(us)",      |     "age"                            |
|    |             |              |   "version": 0                |   ],                                 |
|    |             |              | }                             |   "type": "DATASET",                 |
|    |             |              |                               |   "name": "__Project_2"              |
|    |             |              |                               | }                                    |
|    |             |              |                               | inputVar: __GetVertices_1            |
|    |             |              |                               | columns: [                           |
|    |             |              |                               |   "properties(VERTEX).name AS name", |
|    |             |              |                               |   "properties(VERTEX).age AS age"    |
|    |             |              |                               | ]                                    |
-----+-------------+--------------+-------------------------------+---------------------------------------
|  1 | GetVertices | 0            | {                             | outputVar: {                         |
|    |             |              |   "execTime": "113(us)",      |   "colNames": [],                    |
|    |             |              |   "resp[0]": {                |   "type": "DATASET",                 |
|    |             |              |     "exec": "317(us)",        |   "name": "__GetVertices_1"          |
|    |             |              |     "host": "127.0.0.1:9779", | }                                    |
|    |             |              |     "total": "1045(us)"       | inputVar: __VAR_0                    |
|    |             |              |   },                          | space: 2                             |
|    |             |              |   "rows": 3,                  | dedup: false                         |
|    |             |              |   "totalTime": "1311(us)",    | limit: 9223372036854775807           |
|    |             |              |   "total_rpc": "1214(us)",    | filter:                              |
|    |             |              |   "version": 0                | orderBy: []                          |
|    |             |              | }                             | src: COLUMN[0]                       |
|    |             |              |                               | props: [                             |
|    |             |              |                               |   {                                  |
|    |             |              |                               |     "props": [                       |
|    |             |              |                               |       "_tag",                        |
|    |             |              |                               |       "age",                         |
|    |             |              |                               |       "name"                         |
|    |             |              |                               |     ],                               |
|    |             |              |                               |     "tagId": 3                       |
|    |             |              |                               |   }                                  |
|    |             |              |                               | ]                                    |
|    |             |              |                               | exprs:                               |
-----+-------------+--------------+-------------------------------+---------------------------------------
|  0 | Start       |              | {                             | outputVar: {                         |
|    |             |              |   "execTime": "0(us)",        |   "colNames": [],                    |
|    |             |              |   "rows": 0,                  |   "type": "DATASET",                 |
|    |             |              |   "totalTime": "29(us)",      |   "name": "__Start_0"                |
|    |             |              |   "version": 0                | }                                    |
|    |             |              | }                             |                                      |
-----+-------------+--------------+-------------------------------+---------------------------------------

Wed, 22 Mar 2023 23:25:14 CST

xtcyclist
xtcyclist previously approved these changes Mar 29, 2023
Copy link
Contributor

@jievince jievince left a comment

Choose a reason for hiding this comment

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

Good job

@Sophie-Xie Sophie-Xie merged commit c053e0f into vesoft-inc:master Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants