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

uniq causes lateral subquery to hang #5294

Open
philrz opened this issue Sep 19, 2024 · 0 comments
Open

uniq causes lateral subquery to hang #5294

philrz opened this issue Sep 19, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Sep 19, 2024

tl;dr

This gives the one expected line of output, but then hangs and does not exit.

$ echo '3 1 4 1 5 9 2 6 5 3 5' | zq -z 'array:=collect(this) | over array => (sort | uniq | array:=collect(this))' -
{array:[1,2,3,4,5,6,9]}
[...never exits...]

Details

Repro is with Zed commit 2357e17. I bumped into it while responding to a community Slack thread.

If I rebuild the pipeline gradually, I can see where it starts to hang.

This exits ok:

$ zq -version
Version: v1.17.0-74-g2357e178

$ echo '3 1 4 1 5 9 2 6 5 3 5' | zq -z 'array:=collect(this) | over array => (sort)' -
1
1
2
3
3
4
5
5
5
6
9

But introducing uniq causes the hang.

$ echo '3 1 4 1 5 9 2 6 5 3 5' | zq -z 'array:=collect(this) | over array => (sort | uniq)' -
1
2
3
4
5
6
9
[...never exits...]
@philrz philrz added the bug Something isn't working label Sep 19, 2024
@philrz philrz changed the title Hanging lateral subquery that rebuilds an array uniq causes lateral subquery to hang Sep 19, 2024
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