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

Filtering on SHOW QUERIES results #2875

Closed
randomJoe211 opened this issue Sep 15, 2021 · 2 comments
Closed

Filtering on SHOW QUERIES results #2875

randomJoe211 opened this issue Sep 15, 2021 · 2 comments
Labels
type/bug Type: something is unexpected

Comments

@randomJoe211
Copy link
Contributor

Nebula Graph version: 2.5.0

(root@nebula) [basketballplayer]> SHOW QUERIES | ORDER BY $-.StartTime Desc | Limit 10
+------------------+-----------------+--------+--------------------+----------------------------+----------------+-----------+--------------------------------------------------------+
| SessionID        | ExecutionPlanID | User   | Host               | StartTime                  | DurationInUSec | Status    | Query                                                  |
+------------------+-----------------+--------+--------------------+----------------------------+----------------+-----------+--------------------------------------------------------+
| 1631710188630519 | 25              | "root" | ""127.0.0.1":9669" | 2021-09-15T12:57:06.977388 | 0              | "RUNNING" | "SHOW QUERIES | ORDER BY $-.StartTime Desc | Limit 10" |
+------------------+-----------------+--------+--------------------+----------------------------+----------------+-----------+--------------------------------------------------------+
Got 1 rows (time spent 388/932 us)

Wed, 15 Sep 2021 12:57:06 UTC

(root@nebula) [basketballplayer]> SHOW QUERIES | ORDER BY $-.Status Desc | Limit 10
[ERROR (-1009)]: SemanticError: `$-.status', not exist prop `status'

Wed, 15 Sep 2021 12:57:20 UTC

(root@nebula) [basketballplayer]> SHOW QUERIES | ORDER BY $-.Host Desc | Limit 10
[ERROR (-1009)]: SemanticError: `$-.host', not exist prop `host'

Nebula Graph allows ordering/filtering on the SessionID, ExecutionPlanID, StartTime, and DurationInUSec fields, but does not allow ordering/filtering on the User, Host, Status, and Query fields. Why?

@randomJoe211 randomJoe211 added the type/bug Type: something is unexpected label Sep 15, 2021
@yixinglu
Copy link
Contributor

It seems that Status and Host are keywords in nebula graph. and keywords will be converted to lower case in parser, so sematic checks complain the error of not found the $-.host when you try to use the $-.Host.

We should avoid to use the keywords as the table header or use the lower case words as the header name, what do you think about this @CPWstatic

@CPWstatic
Copy link
Contributor

CPWstatic commented Sep 16, 2021

Please know that host,status,query are keywords, use $-.`Status` instead.

yixinglu pushed a commit to yixinglu/nebula that referenced this issue Sep 14, 2023
…ft-inc#2875)

fix bug (vesoft-inc#5614)

* fix bug

* fix bug

* fix bug

* fix bug

* fix bug

Co-authored-by: hs.zhang <22708345+cangfengzhs@users.noreply.github.com>
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

3 participants