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 empty list/set/map #2894

Closed
Aiee opened this issue Sep 17, 2021 · 4 comments · Fixed by #3302
Closed

Support empty list/set/map #2894

Aiee opened this issue Sep 17, 2021 · 4 comments · Fixed by #3302
Assignees
Labels
incompatible PR: incompatible with the recently released version type/feature req Type: feature request
Milestone

Comments

@Aiee
Copy link
Contributor

Aiee commented Sep 17, 2021

Neo4j:
Screen Shot 2021-09-17 at 5 31 49 PM

Nebula:

(root@nebula) [nba]> RETURN []
[ERROR (-1004)]: SyntaxError: syntax error near `]'


(root@nebula) [nba]> RETURN [1]
+-----+
| [1] |
+-----+
| [1] |
+-----+
Got 1 rows (time spent 574/922 us)


(root@nebula) [nba]> RETURN {}
[ERROR (-1004)]: SyntaxError: syntax error near `}'


(root@nebula) [nba]> RETURN {a:123}
+----------+
| {a:123}  |
+----------+
| {a: 123} |
+----------+
Got 1 rows (time spent 645/1025 us)
(root@nebula) [nba]> LOOKUP ON player WHERE player.age in []
[ERROR (-1004)]: SyntaxError: syntax error near `]'
@Aiee Aiee added the type/bug Type: something is unexpected label Sep 17, 2021
@Aiee Aiee changed the title Do not support empty set Do not support empty list/set/map Sep 17, 2021
@Sophie-Xie Sophie-Xie added this to the v2.6.0 milestone Sep 18, 2021
@jievince
Copy link
Contributor

Empty set has conflict with empty map in the parser syntax

@CPWstatic
Copy link
Contributor

This is not supported at the beginning of design.

@CPWstatic CPWstatic added type/feature req Type: feature request and removed type/bug Type: something is unexpected labels Sep 22, 2021
@Sophie-Xie Sophie-Xie removed this from the v2.6.0 milestone Sep 23, 2021
@Sophie-Xie Sophie-Xie changed the title Do not support empty list/set/map Support empty list/set/map Oct 18, 2021
@Sophie-Xie Sophie-Xie assigned jievince and unassigned CPWstatic Oct 18, 2021
@Sophie-Xie Sophie-Xie added this to the v3.0.0 milestone Oct 18, 2021
@jievince
Copy link
Contributor

jievince commented Nov 4, 2021

GQL supports list, set, multiset, map, its syntax rule is like:

<multiset value constructor by enumeration> ::=
MULTISET <left brace> <multiset element list> <right brace>

For example

List{1, 2, 3}
Set{1, 2, 3}
Multiset{1, 2, 2}
Map{a:1, b:2}

And empty list, empty set, empty map is:

List{}
Set{}
MultiSet{}
Map{}

In this way, there will be no grammatical conflict.

@jievince jievince added the incompatible PR: incompatible with the recently released version label Nov 8, 2021
@jievince
Copy link
Contributor

Since we decided to make gql compatible in versions after 3.0, I recommend that this also could be done in versions after 3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatible PR: incompatible with the recently released version type/feature req Type: feature request
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants