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

Timechart evaluation functions aren't correctly implemented #93

Open
51-code opened this issue Feb 12, 2025 · 0 comments
Open

Timechart evaluation functions aren't correctly implemented #93

51-code opened this issue Feb 12, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@51-code
Copy link
Contributor

51-code commented Feb 12, 2025

Describe the bug

The following query:

%dpl
index=abc earliest=-5y
| spath
| timechart eval(sum(balance))

throws the following exception:
java.lang.IllegalStateException: Parser failure on line 4, column 28 due to mismatched input ')' expecting EVAL_LANGUAGE_MODE_COMMA
Please check that the query is written correctly. Otherwise, please report this error and include the query used and this error.

This can be done without the eval() command in the query. However, evaluations would be needed if the user wants to calculate something with that, say sum(balance) + avg(example) or something like that. But that will throw the same exception.

The reason for the exception is that the evaluation function "sum" would require at least one comma and another field or evaluation function to sum with. But for timechart, the field itself is enough.

The bug happens with avg() too. Probably with all evaluation functions that require multiple fields normally, but in timechart would only require one.

Expected behavior

This should be valid DPL. The query calculates the sum of the field "balance" for each bin in timechart individually.

How to reproduce

Run the query in the description.

Screenshots

Software version

pth_10 version: 8.3.1
pth_03 version: 9.3.0

Desktop (please complete the following information if relevant):

  • OS:
  • Browser:
  • Version:

Additional context

Perhaps the functions could be treated as aggregateFunctions instead of evalStatements? They only require one field.

@51-code 51-code added the bug Something isn't working label Feb 12, 2025
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