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

Sitop command parses the integer incorrectly #46

Open
51-code opened this issue Jul 30, 2024 · 0 comments
Open

Sitop command parses the integer incorrectly #46

51-code opened this issue Jul 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@51-code
Copy link
Contributor

51-code commented Jul 30, 2024

Describe the bug

There is a test case for this query:
| sitop 15 limit=5 foo by bar

which gives the following error:

line 46:11 mismatched input 'limit=' expecting {PIPE, COMMA, GET_FIELD_SINGLE_QUOTED, GET_FIELD_DOUBLE_QUOTED, GET_FIELD_STRING, COMMAND_SITOP_MODE_BY}

This means that the parsing is topped when reaching the limit parameter.

When looking at the parse tree, it is seen that the integer "15" is actually parsed as a FieldListType instead of a IntegerType as it should be. Limit parameter and other optional parameters are only allowed before the fieldListType, so the parser stops.

Expected behavior

Should parse the integer as an IntegerType and then continue to parsing the limit parameter (or other optional parameters).

How to reproduce

Test the query above.

Screenshots

Software version

6.1.0

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

Needs more investigation on why the integer does not parse as an IntegerType. Having it in its own grammar rule in the command might help.

sitopSyntaxParseTest in SitopSyntaxTests.java has been disabled because of this issue in PR #52.

@51-code 51-code added the bug Something isn't working label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant