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

profile/explain via -e/eval with issues #180

Closed
wey-gu opened this issue Oct 24, 2022 · 2 comments
Closed

profile/explain via -e/eval with issues #180

wey-gu opened this issue Oct 24, 2022 · 2 comments
Labels
type/bug Type: something is unexpected

Comments

@wey-gu
Copy link
Contributor

wey-gu commented Oct 24, 2022

$ nebula-console-linux-amd64-v3.0.0 -addr 10.1.1.168 -port 9669 -user root -p nebula -e 'USE basketballplayer; explain MATCH (m) RETURN m'
(root@nebula) [(none)]> USE basketballplayer; explain MATCH (m) RETURN m
[ERROR (-1004)]: SyntaxError: syntax error near `explain'

Mon, 24 Oct 2022 10:08:00 UTC


$ nebula-console-linux-amd64-v3.0.0 -addr 10.1.1.168 -port 9669 -user root -p nebula -e 'USE basketballplayer; profile MATCH (m) RETURN m'
(root@nebula) [(none)]> USE basketballplayer; profile MATCH (m) RETURN m
[ERROR (-1004)]: SyntaxError: syntax error near `profile'

Mon, 24 Oct 2022 10:09:41 UTC

I could mitigate with -f though

❯ echo 'USE basketballplayer;\nPROFILE MATCH (m)-[e0:follow]->(n),(m)-[e1:serve]->(n) WHERE id(m)=="player100" RETURN n,e0,e1;' > profile0.ngql

❯ cat profile0.ngql
USE basketballplayer;
PROFILE MATCH (m)-[e0:follow]->(n),(m)-[e1:serve]->(n) WHERE id(m)=="player100" RETURN n,e0,e1;

❯ nebula-console-linux-amd64-v3.0.0 -addr 10.1.1.168 -port 9669 -user root -p nebula -f profile0.ngql > profile0.log


❯ head profile0.log -n 20
(root@nebula) [(none)]> USE basketballplayer;
Execution succeeded (time spent 1207/1677 us)

Mon, 24 Oct 2022 09:56:46 UTC

(root@nebula) [basketballplayer]> PROFILE MATCH (m)-[e0:follow]->(n),(m)-[e1:serve]->(n) WHERE id(m)=="player100" RETURN n,e0,e1;
+----------------------------------+--------------------------------------------------+-----------------------------------------------------------------------+
| n                                | e0                                               | e1                                                                    |
+----------------------------------+--------------------------------------------------+-----------------------------------------------------------------------+
| ("team204" :team{name: "Spurs"}) | [:follow "player100"->"team204" @0 {degree: 95}] | [:serve "player100"->"team204" @0 {end_year: 2016, start_year: 1997}] |
+----------------------------------+--------------------------------------------------+-----------------------------------------------------------------------+
Got 1 rows (time spent 8638/9799 us)

Execution Plan (optimize time 294 us)

-----+----------------+--------------+--------------------------------------------------------------------------------------------------------+----------------------------------
| id | name           | dependencies | profiling data                                                                                         | operator info                   |
-----+----------------+--------------+--------------------------------------------------------------------------------------------------------+----------------------------------
| 13 | Project        | 12           | ver: 0, rows: 1, execTime: 35us, totalTime: 37us                                                       | outputVar: {                    |
|    |                |              |                                                                                                        |   "colNames": [                 |

@HarrisChu
Copy link
Contributor

> nebula-console -addr 192.168.8.60  -port 9669 -u root -p nebula -e 'explain {USE nba;  MATCH (m) RETURN m}'
(root@nebula) [(none)]> explain {USE nba;  MATCH (m) RETURN m}
Execution succeeded (time spent 735/94176 us)

Execution Plan (optimize time 166 us)

@wey-gu
Copy link
Contributor Author

wey-gu commented Nov 9, 2022

Thanks @HarrisChu and @veezhang !
Closing as the {} expression proposed by @HarrisChu AND @veezhang 's PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Type: something is unexpected
Projects
None yet
Development

No branches or pull requests

2 participants