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

jq:process_json function gets stuck #23

Closed
kjellwinblad opened this issue May 11, 2022 · 2 comments
Closed

jq:process_json function gets stuck #23

kjellwinblad opened this issue May 11, 2022 · 2 comments

Comments

@kjellwinblad
Copy link
Contributor

The jq:process_json function gets stuck when for example given the following input. It does not get stuck when the jq program is given corresponding input.

rebar3 shell
Eshell V12.3  (abort with ^G)
1> jq:process_json("def rem_first: if length > 2 then del(.[0]) else . end; def rem_last: if length >
1 then del(.[-1]) else . end; .date as $date | .sensors[] | .name as $name | (.data | sort | rem_first | rem_last | add / length ) as $average | {name: $name, $average, $date}", <<"{ \"date\": \"2020-04-24\", \"sensors\": [ { \"name\": \"a\", \"data\": [1,2,3,4,5] }, { \"name\": \"b\", \"data\": [-100,1,2,3,4,5,2000] }, { \"name\": \"c\", \"data\": [-100,1,2,3,4,5, -1000] } ] }">>).
@kjellwinblad
Copy link
Contributor Author

I have tried to create a smaller example but it seems like it only get stuck when the program has a certain length.

@kjellwinblad
Copy link
Contributor Author

Fixed in #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant