teragrep / pth_03

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

Timechart whereInstruction handles aggregates incorrectly #23

Open 51-code opened 6 months ago

51-code commented 6 months ago

Describe the bug

index=abc earliest=-4y | timechart count(_raw) by source where sum > 5 Results to an exception: java.lang.IllegalStateException: failed to parse at line 2:63 due to no viable alternative at input 'where sum'

However, using sum(source) in the above query parses. So the problem is that the parser is waiting for a complete aggregateFunction.

Expected behavior

The whereInstruction should only work with the aggregate without the field. The field is defined in the by clause.

How to reproduce

Run the query above.

Screenshots

Software version

5.4.0

Desktop (please complete the following information if relevant):

Additional context

51-code commented 6 months ago

Internal PR created.

However, not going to merge until the relevant changes are ready in PTH-10.