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

Inconsistent output of values with union type #4955

Closed
philrz opened this issue Dec 23, 2023 · 1 comment · Fixed by #4995
Closed

Inconsistent output of values with union type #4955

philrz opened this issue Dec 23, 2023 · 1 comment · Fixed by #4995
Labels
bug Something isn't working

Comments

@philrz
Copy link
Contributor

philrz commented Dec 23, 2023

Repro is with a99b4f9.

This inconsistency was noted by @mccanne.

$ echo '[1]([(int64,string)])' | zq 'yield this[0]+1' -
2

$ echo '1((int64,string))' | zq 'yield this+1' -
error("incompatible types")
@philrz philrz added the bug Something isn't working label Dec 23, 2023
mattnibs added a commit that referenced this issue Jan 18, 2024
mattnibs added a commit that referenced this issue Jan 18, 2024
mattnibs added a commit that referenced this issue Jan 18, 2024
mattnibs added a commit that referenced this issue Jan 18, 2024
@philrz
Copy link
Contributor Author

philrz commented Jan 19, 2024

Verified in Zed commit b58a6d7.

The second repro example above now returns the expected result rather than an error.

$ zq -version
Version: v1.12.0-36-gb58a6d7a

$ echo '1((int64,string))' | zq 'yield this+1' -
2

Thanks @mattnibs!

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