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

Dedup command doesn't require the fieldList parameter #50

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

Dedup command doesn't require the fieldList parameter #50

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

For example, a query like:
| dedup consecutive=true _raw

will result in a parse tree that does not include the "_raw" field.

This has two reasons:

  • The FieldList ("_raw" in this case) is not required, it is optional
  • The optional parameters in dedup are required to be given on the right hand side of the FieldList, even though it should not matter

So, with the query above, the fieldList is not required, so it skips it completely and moves on to parsing the optional parameters ("consecutive") and then it will stop parsing because a fieldList is not expected anymore.

Expected behavior

The query should work.

How to reproduce

Run a query like this:
index=abc | dedup consecutive=true _raw

It actually throws a NullPointerException in PTH-10 because it always expects a FieldList and visits it even though it isn't there for this query.

Screenshots

Software version

6.1.0

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

The grammar change may require changes in PTH-10 as well. For allowing parameters on each side of the FieldList, it probably has to be checked in PTH-10 that each of the parameters is only given once.

dedupConsecutiveOnLeftSideOfFieldListTest and dedupKeepemptyOnLeftSideOfFieldListTest in TicketSyntaxTests.java have 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