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

syntax error #6

Open
happysi opened this issue Mar 31, 2023 · 1 comment
Open

syntax error #6

happysi opened this issue Mar 31, 2023 · 1 comment

Comments

@happysi
Copy link

happysi commented Mar 31, 2023

Error: syntax error, unexpected ',', expecting '}':
{ create: 'movielens', group : [ { movie: ['title', 'genres'] }, { tag: ['user_id', 'tag', 'movie_id'] }, { rate: ['user_id', 'rate', 'movie_id'] } ], index:'tag'};

@webbery
Copy link
Owner

webbery commented Apr 1, 2023

Because each group may have same name of properties, we changed index grammar but README is old.
The latest grammar can be write as follows:

{
    create: 'movielens',
    group: [
        {movie: ['title', 'genres']},
        {tag: ['user_id', 'tag', 'movie_id'], index: ['tag']},
        {rate: ['user_id', 'rate', 'movie_id']}
    ]
};

index should be write in each group.

In gql.y, add index keyword after group seems not implement now:

creation: '{' KW_CREATE ':' LITERAL_STRING ',' groups '}'
            {
              GCreateStmt* createStmt = new GCreateStmt($4, $6);
              free($4);
              $$ = MakeNode(NodeType::CreationStatement, createStmt, nullptr);
              stm._errorCode = ECode_Success;
            }
        | '{' KW_CREATE ':' LITERAL_STRING ',' KW_INDEX ':' call_expr '}'
              {
                free($4);
              }
        ;

But group grammar has changed and you can add index to each group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants