teragrep / pth_03

Data Processing Language (DPL) parser
GNU Affero General Public License v3.0
0 stars 4 forks source link

Sort command only takes up to two fields as parameter #49

Closed 51-code closed 3 weeks ago

51-code commented 1 month ago

Describe the bug

Currently the sort command only takes one or two fields as parameters to sort with.

For example the following query will silently result in an error: | sort offset, index, _raw

Expected behavior

Should work with unlimited amount of fields.

How to reproduce

Run a query like this: index=abc | sort offset, index, _raw | eval a=10

it won't execute the eval command at all in since the parse tree is only created as far as the second comma. Furthermore the _raw column isn't taken into account when sorting.

Screenshots

Software version

6.1.0

Desktop (please complete the following information if relevant):

Additional context

sortParseTest in TicketSyntaxTests.java has been disabled because of this issue in PR #52.

51-code commented 1 month ago

index=abc | sort offset index _raw | eval a=10 works. Seems like sort is supported for multiple fields, just not when separating the fields with commas.

51-code commented 1 month ago

Fixed the bug, but implementing #64 to the same PR to make sure nothing else broke when solving this one.