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

SortBy function panics if invalid consolidation function passed in #101

Closed
carrieedwards opened this issue Sep 7, 2022 · 0 comments · Fixed by #102
Closed

SortBy function panics if invalid consolidation function passed in #101

carrieedwards opened this issue Sep 7, 2022 · 0 comments · Fixed by #102
Labels
bug Something isn't working

Comments

@carrieedwards
Copy link
Collaborator

The sortBy() function takes a consolidation function as a parameter (with a default value of 'average'). If an invalid consolidation function name is passed in, the sortBy() function still attempts to do the sort, calling consolidations.SummarizeValue(). A panic can occur when the 'default' case in the SummarizeValues switch statement is hit.

An example query to replicate this issue:

sortBy(groupByNode(testMetric*, 5, 'max'), 'true', true)

The resulting error that occurs is:

recovered from panic: "runtime error: index out of range [1] with length 1"

@carrieedwards carrieedwards added the bug Something isn't working label Sep 7, 2022
@carrieedwards carrieedwards linked a pull request Sep 9, 2022 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant